How to make redirect_to works in those filters?
I\'m trying to change
def start
....
redirect_to index
end
def end
...
redirect_to index
end
You can change response.location, which has the same effect as calling redirect_to. An example with an after_filter (the same could be done with around):
after_filter :different_redirect, only:[:create]
def different_redirect
if self.status == 302
response.location = other_thing_path
end
end
def create
@my_thing = MyThing.new(params[:my_thing])
respond_to do |format|
if @my_thing.save
format.html { redirect_to(my_things_path) }
else
format.html { render :action => "new" }
end
end
end