So when creating draggable objects it seems to pass the id through
params. The problem is I need the param id from the url. Is there
anyways I can manually get the url id from my controller class or a way
to change draggable to not look for "id". Draggable_element seems too
look for the id tag in the list (<li
id=''ingredient_<%=ingredient.id%>''). Once in the
controller I need the
url id variable as well as the draggable id. Hope that made sense.
Here is the code. Thanks I am very new to this.
<% for ingredient in @all_ingredients%>
<li id=''ingredient_<%=ingredient.id%>''
class=''ingredients''>
<% if ingredient.photos.size > 0 %>
<% main_photo= ingredient.photos.find(:first) %>
<%= link_to(image_tag("ingredients/"+main_photo.name,
:size =>''25x25'',
:border => 1,
:id =>"photo_#{main_photo.id}" ))
%>
<% end %>
<%= ingredient.name %>
</li>
<%= draggable_element "ingredient_#{ingredient.id}" , :revert =>
true %>
When I check my params[:id] in my controller I get the ingredient_3
instead of whats in the url (e.g. 1)
Thanks!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---