4

I would like to develop a web application and also want to support mobile web app Can I use Ruby on rails? If yes

Out of MVC the 'M' and 'C' won't change to develop the mobile web app right? in that case how can I redirect the pages in the controller based on the client. I mean Mobile or Web Browsers??

I am planning to use Jquery Mobile for mobile web app in the view part? Kindly help me out.

4

3 に答える 3

5

Absolutly YES!

Ruby on Rails just a backend tech, is the same as what you plan to do for normal browser. There are only two things that you need to consider about mobile app. First is mobile browser's content size because you need to adjust your layout to fit the size. There is a HTML meta tag called viewport can help you.

Ex.

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

This script will tell user's browser that the content should be fit the devise size,initial-scale defines the viewport rate and maximum-scale defines how many times this page can scale, and user-scalble=0 means user cannot scale the page. More about viewport you can check the Mozilla's doc.

The other thing you need to consider is the HTML5 techs, but actually these aren't problems when you are using jQuery mobile. I recommend you to check their docs. This is very useful and clear for anyone.

于 2012-01-08T16:31:46.933 に答える
2

Yes you can... pls go through sencha-touch for rails for mobile app OR Building Rails app for mobiles..u can even hit the url to see how the rails app works in your mobile browser...http://mobile-sample-app.heroku.com/

于 2013-05-29T07:34:32.133 に答える
0

The quick answer is yes.

Rails is just the back end, it doesn't matter what the client is using, be it laptop, projector, or mobile phone!

Redirecting to a mobile view of your site is fairly simple. The first way that comes to mind is to uses JavaScript's window object to detect the dimensions of the browser and redirect accordingly using window.location.

You will have to set up new views and routes for the mobile version of your app.

于 2012-01-08T16:11:13.010 に答える