neezer
neezer

Reputation: 20570

How do I make my RoR's links absolute?

<%= link_to 'Show', buddy, :only_path => false %>

Doesn't seem to work. I need the full path: http://www.my-server.com/buddy

How do I do this?

Upvotes: 2

Views: 186

Answers (1)

Mike
Mike

Reputation: 1594

If you've defined buddy as a resource in your routes.rb:

map.resources :buddy

then you should be able to do the following:

<%= link_to 'Show', buddy_url(buddy) %>

Upvotes: 4

Related Questions