Hi,
In rails one can provide(not in older versions) flash messages directly in redirect_to method while residing in controller's action to redirect to different path like
But one thing needs attention here is, it works only for named routes and not for routes without names like
Small but this point should be taken in consideration.
In rails one can provide(not in older versions) flash messages directly in redirect_to method while residing in controller's action to redirect to different path like
redirect_to login_path, :notice => 'Please login'
But one thing needs attention here is, it works only for named routes and not for routes without names like
redirect_to {controller: 'session', action: 'login'}, :notice => 'Please login'
Small but this point should be taken in consideration.
Thanks it save me from my senior
ReplyDelete