开发者

Quick Ruby on Rails question on redirect_to in the same Controller

开发者 https://www.devze.com 2022-12-11 06:58 出处:网络
Inside a given controller \"BobsController\" - is the controller argument on the redirect_to method optional, so tha开发者_Go百科t:

Inside a given controller "BobsController" - is the controller argument on the redirect_to method optional, so tha开发者_Go百科t:

redirect_to(:controller => 'bobs', :action => 'index')

is the same as:

redirect_to :action => 'index'

when being used inside the BobsController class? I assume because the controller is derived from the current controller?


Yes you're correct. It assumes the current controller if :controller is not provided.

0

精彩评论

暂无评论...
验证码 换一张
取 消