Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick Ruby on Rails question on redirect_to in the same Controller

Inside a given controller "BobsController" - is the controller argument on the redirect_to method optional, so that:

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?

like image 561
Ash Avatar asked Nov 16 '09 03:11

Ash


1 Answers

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

like image 90
bensie Avatar answered Nov 18 '22 04:11

bensie