In my RESTful app, I have 4 templates for different mime types/formats
(example, below). How do I tell Rails (2.0.2) to use the Builder
template engine as default for rss, or at least look for it at render
time for the RSS MIME Type? Currently it tries to use an erb template
as default.
index.atom.builder
index.rss.builder
index.xml.builder
index.html.erb
My controller action is basically:
def index
@galleries = Gallery.find(:all)
end
Results:
/galleries.rss generates a No Template exception because it tries to
find index.rss.erb instead of index.rss.builder
/galleries.xml seems OK (Browser reports 406 Not Acceptable in
Safari)
/galleries.atom works fine (index.atom.builder)
/galleries works fine (index.html.erb)
I know I can coerce the template to be used, but that seems unclean in
a Rails 2.0 environment. Is there a configuration option to set to
get the right template engine to be invoked?
Any advice appreciated,
–Kip