You can use that technique to do something like this in your helper:

link_to("Link!", { :action => "blah", :controller =>
controller.controller_name })

You don't have to use named routes all the time. There are definitely
times where the path hash is advantageous.

On Jun 15, 9:05 pm, bill walton <[email protected]> wrote:
> On Tue, 2009-06-16 at 03:02 +0200, Älphä Blüë wrote:
> > I want to call/change this path based on the controller that calls it.
>
> Not sure if this is what you seek, but all views have access to the
> controller / action that rendered them via controller.controller_name
> and controller.action_name.
> e.g.;
>
> <% if  controller.controller_name == "rushing_offenses" -%>
>    some stuff
> <% end %>
>
> HTH,
> Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to