transition form respond_to to provides
Matt Aimonetti
mattaimonetti at gmail.com
Mon Nov 26 01:56:32 EST 2007
I really like the new mime type handler however I was trying to convert some
code and couldn't figure out how.
My rails action was handle 2 formats, html and xml
respond_to do |format|
format.html # show.html.erb
format.xml do
if @account.active? && @account.valid_referer?(session[:referer])
render :xml => @account.to_xml(:except => [:id, :created_at])
else
render :text => 'your account has been disable'
end
end
Now that I'm trying to switch this controller to Merb, I can't figure how to
have a custom xml builder and how to have a condition to the mime type
render.
Any help would be greatly appreciated.
Thanks
-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071125/30d8c973/attachment.html
More information about the Merb-devel
mailing list