I'm following the RailsCast video on jQuery and Ajax. I've added the :remote => true
line to the link_to
. In the video, it says that nothing should happen but the link still goes to the page.
jQuery is being loaded (I'm using it for other things in my Rails app).
I'm trying to link to two different resources (things that I've generated through scaffolds) which might be the problem. I'm not sure.
Let me know if you need to see more code.
EDIT
I had the jquery_ujs line after some previous JS. I've moved it to the top and the remote link now does not go to the page. However, with my new.js.erb file, I can't seem to get the form to appear when the link is clicked.
Link code:
<%= link_to 'New Project', new_project_path, :id => "new-project-link", :remote => true %>
new.js.erb:
$('#new-project-link').hide().after('<%= j render("form") %>');
Also, I'm getting a header status of 304 (Not Modified) instead of a 200. Does that matter at all?