Newbie Rails, thanks to the basic JSON type question on this hope.
I have a model books in my app, which are related to the user.
What I would like to learn to do, it uses jQuery to get the JSN object of the user's owners. And then use jQuery to list the results on a div (id = targetdiv).
Where I am not sure, does such a railroad 3 out of the box? Because I have the answer .js, but I think that J.S. Which is necessary, right?
Thank you for helping to know this!
From the view of the rail tracks, you can do this in some relevant controllers like this:
format.js {rendere: json => @ User.books}
Rails knows how to serial objects on JSON objects.
From jQuery's perspective, there are probably a few ways you can use back to convert JSON to HTML and add it to the page which is often suggested
Comments
Post a Comment