How do I stop controller execution after using redirect_to? (Using Rails)

前端 未结 5 736
日久生厌
日久生厌 2020-12-24 10:46

I have a controller with multiple actions that take :year and :month as attributes from the URL. I have made a private method check_date to check the date is valid and check

5条回答
  •  醉梦人生
    2020-12-24 11:38

    You probably want to use filters.

    If you call your check_date as a before_filter in the controller, the fact that it rendered or redirected will prevent the controller from ever calling the action method. It ends there and then.

提交回复
热议问题