Comments
-
Greg Hurrell
Status changed:
- From: New
- To: Open
-
Greg Hurrell
Lo and behold, this is breakage caused by changes in Rails 2.3.0.
Previously the following did the right thing:
format.atom { @comments = @issue.visible_comments }
Looks like now we need:
format.atom { @comments = @issue.visible_comments render :layout => false }
-
Greg Hurrell
I've posted a question to the talk list to ask whether this is a bug/regression in Rails, or whether the new behaviour is intended as an "enhancement". See:
In the meantime, this is an additional incentive to add feed validation to my spec suite to catch this kind of regression in the future.
-
Greg Hurrell
If it turns out that this is not a bug, this page from the guides might help with a way of specifying the correct layout (none) in only one place, instead of repeating
render :layout => false
in every single action of every single controller where I produce an Atom feed.Possibly could make an (empty)
application.atom
layout and see if that gets picked up automatically. Or use thelayout
method in the application controller with aProc
. -
Greg Hurrell
Just tested, unfortunately a layout at
app/views/layouts/application.builder
containing onlyyield
doesn't work. The rendered feed is completely blank. -
Greg Hurrell
Back to testing this again and in the server log you see:
Rendering template within layouts/application Rendering issues/show
The thing is,
layout/application
is actuallylayout/application.haml
so I have no idea why the Haml template is being chosen... -
Greg Hurrell
Looks like the following in my
application_controller.rb
is one way to do an application-wide override for Atom feeds:layout Proc.new { |controller| controller.send(:is_atom?) ? false : 'application' }
Still a mystery why this used to work pre-2.3.0 and now requires a special override.
-
Greg Hurrell
Going to go with that workaround for now, so will mark as "closed" unless some older and wiser on the Rails Google group points out the error in my ways.
-
Greg Hurrell
Status changed:
- From: Open
- To: Closed
-
Greg Hurrell
Summary changed:
- From: Broken issue feeds in development version?
- To: Atom feeds all broken after Rails 2.3.0 RC1 update
-
Greg Hurrell
Have now added specs to catch this kind of breakage in the future.
Add a comment
Comments are now closed for this issue.