ruby on rails - how to rest my app to support mobile phone -
Now I am going to develop a mobile website, both support general HTML format pages and wml format pages (because now General web browsers can view HTML pages on mobile and some older mobile can only support WLL)
First step:
wml page config / initializer / mime_times.rb :: Mime :: Type.register_alias "text / vnd.wap.wml" ,: wml
Second: two formats for an action form Create ge:
class WelcomeController & lt; ApplicationController def index @latest_on_sale_auctions = Auction.latest (15) response_to do | Format | Format.html format.wml End End
This works well as I see: but found: routing error is not matching "/welcome.wml" With {: method =>: get} as I have seen:
And it works well as I see:
My config / routes Rb Like this: ActionController :: routing :: Routes.draw do | Map | Map.root: Admin = & gt; "Welcome" map.connect ': Controller /: Action /: ID' map.connect ': Controller /: Action / ID: Format' End
My Rail version is 2.3. 5, please help me, I need a cool app, both support HTML and wml.
You're in luck! A railsection episode has just come about this topic:
Comments
Post a Comment