Hi, I am trying to get a remote_form_for to work, and I have it currently making the request and updating the div etc... but when it makes the request it is not passing the value of the collection select in the parameters, it is only passing the id, action and controller. Hopefully someone can tell me what I''m doing wrong. Controller Code: def assign_job job = Job.find(params[:id]) job.update_attributes(params[:job]) @result = ''Saved!'' render :partial => ''test'' end View Code: <% for job in @jobs %> <tr class="<%= cycle(''list-line-odd'', ''list-line-even'') %>"> <% remote_form_for :job, job, :url => { :action => ''assign_job'', :id => job }, :update => ''result_'' + job.id.to_s, :complete => visual_effect(:highlight, ''result'') do |f| %> <td><%= job.number %></td> <td><%= job.company.name %></td> <td><%= job.passenger_name %></td> <td><%= job.job_time.strftime(''%H:%M'') %></td> <td><%= %></td> <td><%= %></td> <td><%= f.collection_select(:driver_id, @drivers, :id, :company_name) %></td> <td><%= submit_tag ''Save'' %> <div id=''result_<%= job.id %>''> </div></td> <% end %> </tr> <% end %> -- 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 -~----------~----~----~----~------~----~------~--~---
On Sep 17, 10:17 pm, Ash Forsyth <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, I am trying to get a remote_form_for to work, and I have it > currently making the request and updating the div etc... but when it > makes the request it is not passing the value of the collection select > in the parameters, it is only passing the id, action and controller. > Hopefully someone can tell me what I''m doing wrong. >It would probably help if your html was valid. tr elements can only contain th and td tags (those tags can contain forms, or you can have forms containing a larger part of the document, but sticking a form exactly where you''ve put it isn''t allowed. Fred> Controller Code: > > def assign_job > job = Job.find(params[:id]) > job.update_attributes(params[:job]) > @result = ''Saved!'' > render :partial => ''test'' > > end > > View Code: > > <% for job in @jobs %> > <tr class="<%= cycle(''list-line-odd'', ''list-line-even'') %>"> > > <% remote_form_for :job, job, > :url => { :action => ''assign_job'', :id > => job }, > :update => ''result_'' + job.id.to_s, > :complete => visual_effect(:highlight, > ''result'') do |f| %> > <td><%= job.number %></td> > <td><%= job.company.name %></td> > <td><%= job.passenger_name %></td> > <td><%= job.job_time.strftime(''%H:%M'') %></td> > <td><%= %></td> > <td><%= %></td> > <td><%= f.collection_select(:driver_id, @drivers, :id, > :company_name) %></td> > <td><%= submit_tag ''Save'' %> <div id=''result_<%= job.id %>''> > </div></td> > <% end %> > </tr> > <% end %> > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, that worked perfectly. -- 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 -~----------~----~----~----~------~----~------~--~---