Hello
I’d like to make a list of items and then when an item is clicked, I
display the “edit” view, something like @items = Item.find(:all)
<%= select ‘my_items’, select_options(@items), :onchange =>
remote_function(edit_item_path(item)) %>
How can I pass only the clicked Item to the edit view :
edit_item_path(item)
You might need to set up ‘edit_item’ in your controller to use
params[:item] in this case - I’m not sure. I think that the ‘:with =>
stuff’ is what you need, though.
You might need to set up ‘edit_item’ in your controller to use
params[:item] in this case - I’m not sure. I think that the ‘:with =>
stuff’ is what you need, though.
The problem is that edit_item_path require an id, and must be written
edit_item_path(id) so can someone tell me how change the route
edit_item_path so that It does’nt require this param??
thanks