Using respond_to to send multiple formats to the same view

Hi All,

Hopefully it's obvious what I'm trying to do here:

respond_to do |format|       format.html # show.html.erb       format.fbml { render(:format=>'html')} end

The problem is, the fbml version doesn't work. Rails insists on looking for show.fbml.erb and won't just render show.html.erb. I'd rather not have to write this view twice.

Any ideas on the syntax for this?

Thanks! Tom

unless someone has a better idea, you can use:

format. fbml { render :template => ‘my_model_view_dir/show’ }

Adam

It was suggested in #rubyonrails this morning that you can do format.fbml { render … , :mime_type => Mime::Type[“text/html”] }

Sorry, I should have replied in #rubyonrails this morning but it took me a while to figure out that solution wouldn't work. First of all the Mime::Type class doesn't support , and second of all I'm pretty sure that just controls the MIME type of the response, rather than selecting the format of the view (I could be wrong about that though).

Adam's suggestion (render(:template=>...)) with the full path worked great. Thank you Adam!

Tom