I need to call the create action in controller A, from controller B.
The reason is that I need to redirect differently when I\'m calling from controller B.
This is bad practice to call another controller action.
You should
My opinion:
Third approach is what I used to do often. So I'll show little example.
def create
@my_obj = MyModel.new(params[:my_model])
if @my_obj.save
redirect_to params[:redirect_to] || some_default_path
end
end
So you can send to this action redirect_to param, which can be any path you want.