I'm having trouble wrapping my head around the proper syntax to have
jQuery (in an .js file) grab an HTML attribute and use the value of
that attribute to load a partial.

HTML fragment:
<a href="/toggle" data-remote="true" section="training">

jQuery string (now setting a static partial, I need this to be
dynamic)
$("#services").html("<%= escape_javascript(render(:partial =>
"operations" )) %>").show()

I want the value of "section" as that corresponds to the name of the
partial. I've tried to look at this in Firebug, but I'm not able to
set the proper breakpoint so I can see the context when the jQuery
string is evaluated.

What I want is something like:

foo = $(this).data("section")

$("#services").html("<%= escape_javascript(render(:partial => foo ))
%>").show()

or

$("#services").html("<%= escape_javascript(render(:partial => $
(this).data("section") )) %>").show()

Thank you for you time

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to