Helpefying a list partial


#1

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 %>

"> <%=h todo.prio %> <%=h todo.title %> <%= todo.description.gsub("\n", '
') %>
## It's the part below ##
<td><%= link_to(image_tag("/images/show.png"), :action => 'show_todo', 

:id =>
todo) %>

<%= link_to(image_tag("/images/edit.png"), :action => ‘edit_todo’,
:id =>
todo) %>
<%= link_to(image_tag("/images/delete.png"), { :action =>
‘destroy_todo’, :id => todo }, :confirm => ‘Are you sure?’) %> <% 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!