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
On 3/16/08, Tom [email protected] wrote:
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.
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”] }
On Mon, Mar 17, 2008 at 12:47 PM, Adam C. [email protected] wrote:
format.html # show.html.erb
Adam
–
Ryan B.
Feel free to add me to MSN and/or GTalk as this email.
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
On Mar 16, 7:35 pm, “Ryan B. (Radar)” [email protected]