Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Creating View File for list Method - Ruby on Rails
SUBMITTED BY:
inzi
DATE:
April 3, 2017, 11:34 a.m.
FORMAT:
Ruby
SIZE:
408 Bytes
Raw
Download
Tweet
HITS:
498
Go to comments
Report
Creating
View
File
for
list
Method
-
Ruby
on
Rails
<
% if
@books
.
blank?
%>
<p>
There
are
not
any
books
currently
in
the
system
.
<
/p>
<% else %>
<p>These are the current books in our system</
p
>
<
ul
id
=
"books"
>
<
% @books.each
do
|
c
|
%>
<li>
<
%= link_to c.title, {:action =
>
'show'
,
:id
=>
c
.
id
}
-
%></li>
<
% end %>
</ul>
<
% end %>
<p>
<
%= link_to "Add new Book", {:action =
>
'new'
}
%></p>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus