Topic: How to change the link of an atom feed??

Here the atom builder

@articles.each do |article|
    feed.entry(article) do |entry|
      entry.title(article.title)
      entry.link(:href => url_for(:controller => "public", :action => "articles", :article_id => article.id), :rel=>"alternate", :type => "text/html")
      entry.content(article.body, :type => "html")
      entry.author { |author| author.name("foobar")}
    end
  end

i want to change the link tag hence i've tried entry.link... However the builder automatically generate a link to "/articles/:id". I don't want it since the articles are actually displayed by the "articles" action in the "public" controller.

So how do I change the link tag??


Regards,


UTSAV GUPTA

Re: How to change the link of an atom feed??

feed.entry(article, :url => some_other_path(article)) do
  ...
end

Good luck.

Re: How to change the link of an atom feed??

Brilliant!!

Thank you Sir.

Re: How to change the link of an atom feed??

It works perfect in Rails 3. Saved my day. Thanks.