On Sep 17, 10:17 pm, Ash Forsyth <[EMAIL PROTECTED]>
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to