How do I load content with ujs, jquery and rails?
Posted
by Joseph Silvashy
on Stack Overflow
See other posts from Stack Overflow
or by Joseph Silvashy
Published on 2010-06-12T22:43:52Z
Indexed on
2010/06/12
22:53 UTC
Read the original article
Hit count: 211
I'm trying to figure out the best way to insert content into a light box using rails UJS. I have a link that looks like this:
<%= link_to "login", login_path, :remote => true %>
Which produces html as such:
<a data-remote="true" href="/login">login</a>
So this all works great, and I've created the view file: user_sessions/new.js.erb
which also loads just fine, but my question what is the preferred method of inserting appending the html into the page? Like I already have the login form on the non-js page, so can't I just load that partial into the page?
Any ideas would be very welcomed.
© Stack Overflow or respective owner