wenhao.xu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Dec-30 08:11 UTC
How could I let rails render wml by default with render/redirect_to method in the controller
Hi all,
I am using rails to create a wap site. I have using the following code
in the rails to make it work:
#environment.rb
Mime::Type.register "text/vnd.wap.wml", :wml
#controller
def index
..... # some unrelated code
respond_to do |format|
format.wml # index.wml.erb
end
end
and I created the view as index.wml.erb
It works well when I visit the site, but if I using redirect_to or
render method in the controller instance method, the browser will tell
me template missing like show.html.erb, which means rails try to
render the view by .html.erb rather than the wml.
Is there any way I could let rails always trying to render .wml by
default?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---