I’m trying to put together an atom feed. In trying to keep things DRY
it seemed to make sense to render each item in the feed with the same
html partial that we used to render it on our website. Unfortunately
render doesn’t seem able to find the template.
More specifically let’s say my controller has an action like this:
@topics = Datasource.list
respond_to do |wants|
render :layout => false
And buried inside my index.atom.builder there is a call to render
shared/topic like so:
entry.content(render( :partial => ‘/shared/topic’, :object =>
topic ), :type => ‘html’)
I was assuming this would find the file at shared/_topic.html.erb and
render it appropriately. No luck though, it gives me the error:
Couldn’t find template file for /shared/_topic in ["/Users/jjb/eng/app/
If I specify the full filename for the template (/shared/
topic.html.erb) it finds it, but that template has nested
“render :partial” calls without the “.html.erb” on the end so they
fail with the same error mentioned above.
Any help would be greatly appreciated.