I’m constructing a feed in rails and I would like the entire show path for my items to be returned in the content portion. My current code only prints the path without the root.
entry.content link_path(link) returns something like links/44 but I would like to return http://www.example.com/links/44. Using the root of wherever the app is being hosted. Thanks for any help.
atom_feed do |feed|
feed.title "Wrld"
feed.updated @links.first.created_at
@links.each do |link|
feed.entry link do |entry|
entry.title link.title
entry.content link_path(link), :type => 'html'
entry.author do |author|
author.name "Wrld"
end
end
end
end
UPDATE
Thanks Leonid, link_url(link) did it
link_urlis what you’re looking for. In general any route helper with_pathreturns the path part and the_urlhelper returns the entire URL.