Getting Controller and Action Names

I figured it would be the easiest thing to do but for some odd reason
I am having a hard time to figure out how to do this.

I can get the action using @action_name but I can’t get the
controller using @controller_name. What is the correct way to go
about doing this?

Thanks for your help.

Your Friend,

John K.


http://www.soen.info - where software engineering knowledge gets indexed
http://cusec.soen.info - software engineering conference

I use the following and it seems to work:

@params[:controller]

Regards,

Michael

John K. [email protected] wrote:
I figured it would be the easiest thing to do but for some odd reason
I am having a hard time to figure out how to do this.

I can get the action using @action_name but I can’t get the
controller using @controller_name. What is the correct way to go
about doing this?

Thanks for your help.

Your Friend,

John K.


http://www.soen.info - where software engineering knowledge gets indexed
http://cusec.soen.info - software engineering conference

I use controller.controller_name

And to see the other params available:

<%= debug(params) %>

within your view.

Regards,

Michael

John K. [email protected] wrote:
I figured it would be the easiest thing to do but for some odd reason
I am having a hard time to figure out how to do this.

I can get the action using @action_name but I can’t get the
controller using @controller_name. What is the correct way to go
about doing this?

Thanks for your help.

Your Friend,

John K.


http://www.soen.info - where software engineering knowledge gets indexed
http://cusec.soen.info - software engineering conference

Not sure why my last reply didn’t get to this list. I’ll try again - if
it shows up then sorry for the duplicate post:

@params[:controller]

Regards,

Michael

John K. [email protected] wrote:
I figured it would be the easiest thing to do but for some odd reason
I am having a hard time to figure out how to do this.

I can get the action using @action_name but I can’t get the
controller using @controller_name. What is the correct way to go
about doing this?

Thanks for your help.

Your Friend,

John K.


http://www.soen.info - where software engineering knowledge gets indexed
http://cusec.soen.info - software engineering conference

On Sun, 2005-11-13 at 13:12 -0800, Michael wrote:

I use the following and it seems to work:

@params[:controller]

Michael,

Just a quick, FYI…

@params, @request, etc… are deprecated.[1]

You can and should now use params, request, etc.

[1] http://rubyurl.com/xaG (params v.s. @params in rails?)

Cheers,

Robby

Thank you Robby! Interestingly, I am new to Rails - I think I got the
info from the agile book. I will switch accordingly…

Michael

Robby R. [email protected] wrote:
On Sun, 2005-11-13 at 13:12 -0800, Michael wrote:

I use the following and it seems to work:

@params[:controller]

Michael,

Just a quick, FYI…

@params, @request, etc… are deprecated.[1]

You can and should now use params, request, etc.

[1] http://rubyurl.com/xaG (params v.s. @params in rails?)

Cheers,

Robby