Hi!
I’m using this form_remote_tag to add an element, and a link_to_remote
to remove one. Strangely the link works, the form_remote_tag also works,
but does not Ajax-like change the page, but render the partial template
“notes” and display only it.
Both controller-functions do some action and at the end call render
:partial => “notes”. The hidden form_remote_tag is found in the main
template, the link in the partial template “notes”.
I don’t get why one does it, the other one not, what could that be?
<%= form_remote_tag(:url => {:action => “add_ajax_note”},
:update => “notes_list”,
:html => {:style => “display: none;”,
:id => “addnote_form”}) %>
<%= hidden_field_tag(“notefile”, “14”) %>
<%= submit_tag ‘add’, :id => ‘add_button’, :style => “display: none;” %>
<%= link_to_remote(“Delete”, :update => “notes_list”,
:url => { :action => “ajax_destroy”, :id => item.id, :notefile => @nfile
},
:loading => “Notes.loading()”,
:complete => “Notes.note_file_added()”) %>