Hi all,
I''ve got this code which is alway the same. In a list it displays a
show, edit
and destroy icon behind each record.
<% for todo in @todos %>
<tr valign="top" class="ListLine<%=
cycle("0","1") %>">
<td><%=h todo.prio %></td>
<td><%=h todo.title %></td>
<td><%= todo.description.gsub("\n", ''<br
/>'') %></td>
## It''s the part below ##
<td><%= link_to(image_tag("/images/show.png"), :action =>
''show_todo'', :id =>
todo) %></td>
<td><%= link_to(image_tag("/images/edit.png"), :action =>
''edit_todo'', :id =>
todo) %></td>
<td><%= link_to(image_tag("/images/delete.png"), { :action
=>
''destroy_todo'', :id => todo }, :confirm => ''Are
you sure?'') %></td>
</tr>
<% end %>
The only thing that changes is the word ''todo''. Ik would like
something like:
<% crud(current list item) %>
Is that doable? And is a helper the right place to put this or should id go in
a partial?
Thanx.
Grtz Gerard.
--
"Who cares if it doesn''t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..."
My $Grtz =~ Gerard;
~
:wq!