I have this code: <b>Repuestos</b><br /> <select name="repair_ticket[rp_item]"> <% @rp_parts.each do |rp_part| %> <option value="<%= rp_part.id %>" <%= '' selected'' if rp_part.id == @repair_ticket.rp_item %>> <%= rp_part.name%> </option> <% end %> </select></p> <% form_remote_tag :url => { :action => :add_to_repair, :id => @repair_ticket.id, :aaaa => @repair_ticket.rp_item } do %> <%= submit_tag "Add repair_part" %> <% end %> I don''t know how to send the rp_part.name from :aaaa. Is is possible outside a form like the form in new.rhtml? -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi John, I was originally going to try and correct your code, but perhaps a sample app is easier Please download from http://www.authomedia.co.uk/dev/repairs.zip and see how you get on. The models might not be quite what you have, but it shows a simple RESTful controller setup with a HABTM join table and AJAX create/destroy associations. Should put you back on track Joe John Smith wrote:> I have this code: > > > <b>Repuestos</b><br /> > <select name="repair_ticket[rp_item]"> > <% @rp_parts.each do |rp_part| %> > <option value="<%= rp_part.id %>" > <%= '' selected'' if rp_part.id == @repair_ticket.rp_item %>> > <%= rp_part.name%> > </option> > <% end %> > </select></p> > > > <% form_remote_tag :url => { :action => :add_to_repair, :id => > @repair_ticket.id, :aaaa => @repair_ticket.rp_item } do %> > <%= submit_tag "Add repair_part" %> > <% end %> > > I don''t know how to send the rp_part.name from :aaaa. Is is possible > outside a form like the form in new.rhtml? > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
Wildtangent wrote:> Hi John, > I was originally going to try and correct your code, but perhaps a > sample app is easier > Please download from http://www.authomedia.co.uk/dev/repairs.zip and > see how you get on. The models might not be quite what you have, but > it shows a simple RESTful controller setup with a HABTM join table and > AJAX create/destroy associations. > > Should put you back on track > > JoeOk, thrank you very much. I think this simple app will be very helpful and will be the new base for my project. Anyway, does anybody know if I can do something with my code? For now on, I only want to know it in order to gain experience. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---