My Code is here
<table>
<% for category in @categories %>
<tr>
<td width="10%"><%= radio_button
''category'', ''id'', category.id %><%= h
category.name %></td>
</tr>
<% end %>
</table>
<br />
<%= 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?
--
http://sourceforge.net/projects/mycodeline/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
<%= link_to_remote ''Edit'',
:update => ''category'',
:url => { :action => ''edit'', :id =>
category[id]},
:with => "''id='' +
$(''id_of_your_element_here'').value"
%>
;)
--
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
-~----------~----~----~----~------~----~------~--~---
oups... do not forget to delete your id from your :url hash ;) -- 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 -~----------~----~----~----~------~----~------~--~---
There is still a problem. I inspect the DOM, that is
<tr>
<td width="10%"><input id="category_id_1"
name="category[id]"
value="1" type="radio">root</td>
</tr>
<tr>
<td width="10%"><input id="category_id_10"
name="category[id]"
value="10" type="radio">root2</td>
</tr>
<tr>
<td width="10%"><input id="category_id_11"
name="category[id]"
value="11" type="radio">root3</td>
</tr>
<tr>
<td width="10%"><input id="category_id_13"
name="category[id]"
value="13" type="radio">root4</td>
</tr>
as you can see, I can''t use $() to get the radio value because the id
is
dynamic created
On 6/20/07, Titou Titou
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> oups... do not forget to delete your id from your :url hash ;)
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
http://sourceforge.net/projects/mycodeline/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---