Hi,
I have a requirement to use an Ajax in place editor on a set of snippets
to
allow user to modify existing content. Once edited, however, I want the
ok
button to NOT modify the original snippet, but instead, send the content
to
another action, which then updates a different object.
Currently, I have the following code:
_snippets.html.erb
<%for snippet in @snippets%>
...<%= snippet.paragraph %>...
<%= set_page_snippet_url = url_for( :controller => 'books', :action => 'set_page_snippet', :snippet_id => snippet.id, :relative_id => @relative.id )%> <%end%>books_controller.rb
def set_page_snippet
…
end
The problem I see is:
- the set_page_snippet never fires (when I add a debugger line to
set_page_snippet) - On clicking ok after editing a snippet, the snippet that was edited
changes to show the home page
How can I get the original snippet to remain unchanged after edit and
have
the set_page_snippet to fire (with params[:value] containing the edited
text)?
Thanks
Anand