I have some truble redirecting my users to the previous page.
Here is an example update method in the movie controller.
def update @movie = Movie.find(params[:id]) if @movie.update_attributes(params[:movie]) flash[:notice] = "The given movie is now updated." end respond_with(@movie, location: :back) end
I get this error.
undefined method 'hash_for_back_url' for #<Module:0x00000103eeaaa8>
in the respond_with
line.
I am using Rails 3.1 rc1 with Ruby 1.9.
It works when it does something like this.
respond_with(@movie, location: request.referer)
Does anyone know why the :back
argument will not work?
Oleander
source share