On Jan 6, 2:31 pm, Michal Burak
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> Hi,
>
> I am using rails 2.3.4..
>
> Any idea how to implement such thing?:
>
> def secondary_menu_link_to(link_name, link_path)
> if (link_path is the current @controller.controller_path and
> @controller.action_name)
> link_to "&racuo; #{link_name}", link_path
> else
> link_to link_name, link_path
> end
> end
>
> I don''t know how to exactly implement the "if
condition".
>
> I am using RESTful resources, so I don''t use :controller => ...
and
> :action => when constructing menu links, I use the REST helper methods.
> sample call of this method in a view:
>
> <%= secondary_menu_link_to("Users", users_path) -%>
>
> Thanks!
>
> M.
> --
> Posted viahttp://www.ruby-forum.com/.
Sounds like you want current_page?
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001603
http://www.railsapi.com is a *fantastic* tool for searching
documentation when you get stuck like this.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.