stevanicus wrote:
> <% @tasklists.each do |tasklist| %>
> <%= check_box("task", "done") %>
> <%= tasklist.task %>
> <%= link_to("Edit", :action => "edit", :id => @tasklists.id) %>
> <br />
> <%end%>


What you've done (just to expand on *why* it doesn't work) is you've 
called the "id" method on @tasklists which is an Array instance, not an 
Active::Record descended model object.  So it's returning the unique 
Object#object_id instead of a database record id (which is why your 
error message says "29134536" instead of "1").  In fact if you look at 
your logs you'll probably see a gripe that Object#id is deprecated and 
you should use Object#object_id instead.

$ ruby -le 'puts Array.new().id'
-e:1: warning: Object#id will be deprecated; use Object#object_id
941526

As you can see that number's not going to be anywhere near what your 
valid record ids are.

What you want to do is pass the AR instance to link_to, or call the id 
method on that instead (which link_to does behind the scenes if passed 
an object which implements "id"; your problem was that while Array can 
do id it's not the right id method).

-- 
Posted via http://www.ruby-forum.com/.