I am a beginner with Ruby on Rails. I have been able to build a small application with the help of ROR.
I want to fetch and load some of my data without loading the whole page. On click of different links, data should be uploaded in the respective div. I am trying to provide :remote=>true property on the link. But this property is not rendering an attribute properly.
After following multiple links on Rails with Ajax, I found that in view links should be given as:
<%= link_to cateogary.cateogary_name, :controller => "cateogaries", :action => "show_async", :id => cateogary_id, :remote => true %>
This should be converted to:
<a href="/cateogaries/12/show_async data-remote=true">
While, this is converted to:
<a href="/cateogaries/12/show_async?remote=true">
What could be its probable reason?
Please forward some good link which provides complete Ajax implementation in ROR.
Rails is recognizing
:remote => trueas a parameter for the URL. Try this:Or maybe this:
Additionally, I’d recommend you to read this (and also check the links).