How to get radio_button's value in link_to_remote

My Code is here

<% for category in @categories %> <% end %>
<%= radio_button 'category', 'id', category.id %><%= h category.name %>

<%= link_to_remote 'Edit', :update => 'category', :url => { :action => 'edit', :id => category[id]} %>

I don’t get the radio_button’s value, how can I get radio_button’s value
in
link_to_remote?


<%= link_to_remote ‘Edit’,
:update => ‘category’,
:url => { :action => ‘edit’, :id => category[id]},
:with => “‘id=’ + $(‘id_of_your_element_here’).value”
%>

:wink:

oups… do not forget to delete your id from your :url hash :wink:

There is still a problem. I inspect the DOM, that is

root root2 root3 root4

as you can see, I can’t use $() to get the radio value because the id is
dynamic created

On 6/20/07, Titou T. [email protected] wrote:

oups… do not forget to delete your id from your :url hash :wink:


Posted via http://www.ruby-forum.com/.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs