On 10/1/06, snacktime <snacktime-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I was wondering if edge rails supports the +xml suffix to mime types?
> At the present if you send a request to rails using application/xml or
> text/xml it will parse the xml and stick it into params, which is
> quite nice and I have been using it. However we need to use a custom
> mime type and treating mime types that have the +xml suffix as valid
> xml would be nice.
>
> Chris
>
So after looking around I found out that rails will work with the +xml
suffix but you have to add your custom mime type first.
Mime::Types.register is documented in rails 1.1, but the method
doesn''t actually exist.. So for anyone else looking to register a
custom mime type here is one way to do it. In environment.rb do this:
Mime::LOOKUP["application/your-custom-mime-type"] = Mime::XML
And rails will in fact look for the +xml suffix on mime types
registered as Mime::XML
Chris.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---