How can I detect the controller and action from a request?
Thanks…
How can I detect the controller and action from a request?
Thanks…
@params[:controller] and @params[:action]
csn
— Matias S. [email protected] wrote:
How can I detect the controller and action from a request?
Thanks…
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
In views:
controller.name
controller.action_name
will give you the controller and action names.
On Sun, Dec 04, 2005 at 03:10:07PM -0500, Hammed M. wrote:
In views:
controller.name
controller.action_name
You can’t just do controller.class.name because the controller class is
called
FooController. Like ‘action_name’, there is a specialized
‘controller_name’
method.
PublicationController.new().class.name
=> “PublicationController”
PublicationController.new().controller_name
=> “publication”
marcel
I stand corrected. Thanks.
Hammed M.
escribió:> > controller.action_name
>> PublicationController.new().controller_name http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
thanks everybody, I solved my problem with these things you said me…
thanks…
Matias
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs