<input type="radio" name="edit_option" checked="checked"
value="this_appt" onclick =
"$('edit_appt_frequency_<%...@appt_to_edit.id%>').show()">
this should do it. You are inside HTML code and not inside a ruby
string, so the #{} syntax won't work. Instead you have to use the Erb
sequence <%= %>
On Feb 17, 5:46 am, David <[email protected]> wrote:
> I am trying to get a div to show when a radio button is clicked but
> the problem is that the div is dynamically named. I am using the
> normal html for a radio button:
>
> <input type="radio" name="edit_option" checked="checked"
> value="this_appt">
>
> Because observe field does not work well with radio buttons. I have
> tried adding an onclick with the div id:
>
> <input type="radio" name="edit_option" checked="checked"
> value="this_appt" onclick =
> "$('edit_appt_frequency...@appt_to_edit.id}').show()">
>
> But the #...@appt_to_edit.id} does not get rendered and I have had a lot
> trouble figuring out how to do this. I think I need to use some sort
> of inline RJS? Im not sure, does anyone have any ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---