I’ve got a link to remote that I believe should be working, but doesn’t
seem in fact to do anything. I’m looking at the webrick log, since
the Book says I should be seeing some hot POST action in there, but
there’s literally no change when I click on the JS link. From looking at
the source that’s generate, it seems like it should work. If I take the
link it generates there out and put it in the address bar, it works
fine.
I’ve got a link to remote that I believe should be working, but doesn’t
seem in fact to do anything. I’m looking at the webrick log, since
the Book says I should be seeing some hot POST action in there, but
there’s literally no change when I click on the JS link. From looking at
the source that’s generate, it seems like it should work. If I take the
link it generates there out and put it in the address bar, it works
fine.
render :layout => false works at home =(
show_note.rhtml is used and not the main layout…
This was very strange. I still don’t know what’s going on. It works now,
but I had to change things.
it turns out with the link_to_remote code above, the
Project.show_note method was never getting called at all. It was going
right to the show_note.rhtml file (I assume that’s known, but the
impression I got from the book example is that this would be going to a
method (hence the render: bit).
So I just made show_note.rhmtl into a shell, with this only:
<%= render :partial => ‘show_note’ %>
And took the guts of it and put it into “_show_note.rhtml”. This works
fine, it doesn’t render the layout again.
if I tried to change the link_to_remote so that instead of
:show_note, the action was project.show_note, that DID call the project
show_note method. Unfortunately, it didn’t seem to pass the ID to it,
and also, all the “render” calls I tried came up as unknown methods or
something. So I gave up on that for now.
I think I want a whole Rails book on just AJAX<>Rails.