From: Mike Fletcher Date: 2005-12-06T04:16:54+09:00 Subject: Re: a todo list jeff.darklight wrote: > When used in link_to statement within rails the :id => item syntax > simply > assigns the unique id of the record to a hidden form element under the > name > "id" . Right. And it's smart enough to not just blindly call id on what's passed (I thought would, but I just actually tried it and I'm wrong) to get that unique value. My mention of the deprecation warning was a red herring. > > So, I hope that helps provide context. The above code ( and/or the code > from my previous posting ) has/have absolutely NOTHING to do with ruby's > object#id. However the original code: > <%= link_to("Edit", :action => "edit", :id => @tasklists.id) %> *is* calling Object#id via an Array instance rather than letting AR do it's magic. That's why there's a value for id, and also why it's a useless value. Had he done ":id => @tasklists" instead there wouldn't have been an id value on the end (pointing at ".../tasklist/edit/" instead of ".../tasklist/edit/29134536" like it did) and he would have had a different problem (depending on how his edit action handles a missing id as opposed to an invalid one). -- Posted via http://www.ruby-forum.com/.