Nevermind, I was able to get eval(url_for(...)) to work, I had
suspected that the link_to method call was not the problem



            <% ['activity', 'submitted', 'saved', 'comments'].each do |
action| %>
            <%= link_to_unless_current action.capitalize,
eval("url_for(user_#{action}_url(:login => @user.login))") do
                  link_to action.capitalize,
eval("url_for(user_#{action}_url(:login => @user.login))"), {:class =>
'current'}
                end %>
            <% end %>

On Feb 10, 9:33 am, tom hartwell <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm trying to DRY up my links on my layout by doing this:
>
> <% ['activity', 'submitted', 'saved', 'comments'].each do |action| %>
>   <%= link_to_unless_current action.capitalize,
> "user_#{action}_url(:login => @user.login)" do
>             link_to_unless_current action.capitalize,
> "user_#{action}_url(:login => @user.login), {:class => 'current'})"
>           end %>
> <% end %>
>
> I've tried to self.send the user_xxx_url to the ActionView, but the
> route method is undefined in the ActionView class.  I'm looking at the
> call stack for named routes, but thought I'd throw it out there while
> I'm doing my research to possibly get a solution faster.
>
> Thanks,
> Tom
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to