Forum: Ruby on Rails How could I let rails render wml by default with render/redirect_to method in the controller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2008-12-30 10:12
(Received via mailing list)
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
This topic is locked and can not be replied to.