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 via http://www.ruby-forum.com/.
-- 
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