I'm using Rails 3 and I have an ajax form (i.e. :remote => true) that hit's a "insert" action on my controller.
What I want is for the user to stay on the index page but be able to display flash messages set by the "insert" action in the controller.
Currently my "insert" action does something like:
def insert
begin
# perform insert of stuff
flash[:success] = "Successfully..."
rescue
flash[:error] = "failed ..."
end
render :nothing => true
end
This allows the form (on index.html.erb) to be submitted and keeps the user on that page but no flash messages show up. How can I get the flash messages to appear? (guessing it has to do with the render :nothing stuff, but without that I get "missing template" errors in the server log).