Is there a way to know what action you're in?

I have a partial that is placed in many different pages, or, in rails
terms, participates in many different actions.

So, the partial _list.rhtml is on

./admin/show.rhtml

and it’s also on

./admin/find.rhtml

I want the partial _list.rhtml to have different behaviors for show
and find. Is there an object available on a page, that contains the
controller and action for that page?

Charlie

If you just want to know the action that was requested in the url,
params[:action] will have it

charlie caroff wrote:

I want the partial _list.rhtml to have different behaviors for show
and find. Is there an object available on a page, that contains the
controller and action for that page?

Charlie


Sincerely,

William P.

http://www.billpratt.net
[email protected]

Thank you. And, for the sake of other newbies like me,
params[:controller] has the controller name in it.

Charlie

Sorry about that, I missed the part about the controller. Not enough
coffee yet :slight_smile:

charlie caroff wrote:

and it’s also on
Sincerely,

William P.

http://www.billpratt.net
[email protected]


Sincerely,

William P.

http://www.billpratt.net
[email protected]