Hi all
I wanted to try out the RJS thing for updating more than just one HTML
element using AJAX.
I have a selection like that:
<select id="booking_musician_profile_id"
name="booking[musician_profile_id]">
<option value="4" selected="selected">Danc!ng
TortoYse</option>
<option value="2">DJ Psyhigh</option>
<option value="1">DJ Yanniv Gold</option>
</select>
I observate it using the following observator:
<%= observe_field(:booking_musician_profile_id,
:url => { :action => :update_new_form }) %>
Now I have a question: why is there now request.raw_post available?
It''s
just empty, but I''d like it to store the ID of my selected option!
Also params only includes the :controller and :action values...
I don''t get it, why is it missing? Everything works fine: the update
and
stuff is being made, my update_new_form.rjs does its action - but
without the wanted ID I can''t do what I want to do!
Anyone knows the solution? Thanks a lot.
Joshua
--
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
-~----------~----~----~----~------~----~------~--~---
Hi Joshua, Joshua Muheim wrote:> <%= observe_field(:booking_musician_profile_id, > :url => { :action => :update_new_form }) %><snip>> I''d like it to store the ID of my selected option! > Also params only includes the :controller and :action values...The easiest way to do pass back the value is to use the (very poorly documented) '':with'' option. In your case: <%= observe_field(:booking_musician_profile_id, :url => { :action => :update_new_form } :with => ''player_id'' ) %> In this example, in your controller, params[:player_id] will hold the value you''re looking for. You could call it anything you want in the :with assignment. It just specifies what you''re going to name the key in the params hash. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---