[Ror-es] como mostrar solo algunos campos de la base de datos
Jose Pepe
ruby-forum-incoming at andreas-s.net
Sun Dec 17 15:39:55 GMT 2006
Eureka,
solo enseño les campos First Name y Last Name
<h1>Listing people</h1>
<table>
<tr>
<!--
<% for column in Person.content_columns %>
<th><%= column.human_name %></th>
<% end %>
-->
<th>First Name</th>
<th>Last Name</th>
</tr>
<% for person in @people %>
<tr>
<td><%=h person.FirstName %></td>
<td><%=h person.LastName %></td>
</tr>
<% end %>
<!--
<% for column in Person.content_columns %>
<td><%=h person.send(column.name) %></td>
<% end %>
-->
<td><%= link_to 'Show', :action => 'show', :id => person %></td>
<td><%= link_to 'Edit', :action => 'edit', :id => person %></td>
<td><%= link_to 'Destroy', { :action => 'destroy', :id => person },
:confirm => 'Are you sure?', :post => true %></td>
</tr>
<% end %>
</table>
<%= link_to 'Previous page', { :page => @person_pages.current.previous }
if @person_pages.current.previous %>
<%= link_to 'Next page', { :page => @person_pages.current.next } if
@person_pages.current.next %>
<br />
<%= link_to 'New person', :action => 'new' %>
--
Posted via http://www.ruby-forum.com/.
More information about the Ror-es
mailing list