Can we use Ruby on rails to develop a mobile web app? - ruby-on-rails

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.

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.

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/

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.

Related

Can't view/change input field in iframe on phonegap app

So here's the situation. I am using a third party digital document signing service called PandaDoc in my mobile application which is built on PhoneGap/Cordova and I am not able to change any of the input, text-type fields when attempting to do this via the mobile app on an iPhone (haven't tested Android yet).
Here are some things i noted about this:
1) When viewed online in Chrome (on my laptop) or on my phone in the Chrome browser everything works fine.
2) The only form elements that aren't working on mobile are the input (type=text) ones. The checkboxes work, the dropdowns work etc...
3) I don't know much about Angular.js but i can tell this third party app was built on it. When i inspect and compare the mobile vs web version i noticed that on the mobile version the input fields have these two directives:
ng-pristine and ng-touched
From what i can tell researching these, they seem to be mutually exclusive so not sure how that would affect things. Also the web version had:
ng-dirty and ng-valid-parse
both of which the mobile version did not have.
I know it would be best if i could post some code here but i don't know where to start. In my app there is just a simple embed script that puts the PandaDoc into an iFrame.
If you want to see the mobile test version of this app you can view it at http://dev.velexo.com/m2 I have a test user with a username of "mobile2" and the password is "pass". Unfortunately there is no easy way to send out the iphone app version of this and that is where the problem is.
Oh also, when you log into the application, click on the W9 Information button and then the Enter Your W9 button, this is what brings up the pandadoc
Also should have mentioned I'm using JQuery Mobile in the app.
Any advice/guidance would be welcome even if it's just a guess.
just looking over my old questions here. The answer to the actual question I asked is that you can not change anything in an iFrame from the parent frame unless both the domain and the port match due to the cross-domain policy restraints.
There are no ways around this that I am aware of.
The solution to my particular problem was to get rid of PandaDoc entirely because it just wasn't designed to be used on a mobile device. In the end i wrote my own javascript for creating a signature and passing to the backend where i used a php pdf generating library to construct the final document.

Is there a way to display different content on mobile vs. desktop in Rails?

I have a rails app that uses bootstrap. It's meant to be used on mobile (it focuses heavily on geolocation from your phone's gps). I want to make the app accessible if you visit from your mobile device, but if you visit from your desktop/laptop/tablet, a message should appear stating that it's only meant for use on phones. Is this possible to do in Rails? Thanks!
Yes.
Mobile Fu is a rails gem that allows you to do this. You just need to check if the request is from a mobile device and subsequently render whatever you want to based on that. If you're on Rails 4 this might be helpful too.

How do I add code in Salesforce 1?

I am a beginner in the Salesforce 1 platform. I started this internship and I am being asked to create a jQuery Mobile app in Salesforce 1. I have learned how to build the app, but I am lost as to how to add code to it. I am a beginner developer being asked to recreate a Mobile app that is more for someone with more experience. I am not going to give up, because I know this is a good learning experience for me. The Salesforce resources have not been helpful to me. Can you help me try to figure out how to get started with this? Do I connect the app to a Salesforce page or is there another developing tool I am missing? Also I cannot add the jQuery Mobile library to be able to get my code to work. How does that app connect to the code? I am confused how the objects and fields relate to the code I write for the app. Help!
Just create a VF page, create a tab and assign the VF page to that tab. The VF page should be "Mobile Ready" i.e. you should check the checkbox when you create the VF page. For jQuery libraries, you have to add them as static resources.
Please let me know in case you need more help.
Yes. the other user is correct. Upload the "min" version of the jQuery as a static resource to invoke jQuery on your Visualforce page.
As for designing mobile apps on the Salesforce platform, you need to know quite a bit:
MVC model in Salesforce
Apex, SOQL, SOSL
Visualforce controllers
Visualforce
HTML and DOM
CSS
JavaScript
Possibly the Mobile SDK for Salesforce
Possibly Canvas for Salesforce
Possibly XML for Flexipages
If you look on developer.salesforce.com, you'll find learning resources for all of these topics. There's even a workbook for you: http://www.salesforce.com/us/developer/docs/salesforce1/salesforce1_guide.pdf.
Google's browser offers a mobile emulator for iOS so that developers can develop on one platform and test on many platforms. Its is difficult to use though, imho. It has quite a learning curve.

"Enhanced experience except without Ajax navigation features."

I've got a good understanding of regular jQuery and AJAX in desktop browsers.
I'm developing my first mobile site using jQuery Mobile 1.0. I was going through the Mobile Graded Browser Support and noticed a few devices listed under "Enhanced experience except without Ajax navigation features."
Can someone shed some light on what that means exactly?
Will I still be able to make $.ajax() calls to the server?
Can I still use the "hashchange" event?
Can I still link to anchors on the same page with links to "#anchor-name"?
I'm planning on using the Multi-Page Template and the client has specifically asked about BlackBerry support.
You will be able to use $.ajax() and haschange events only on Blackebrry 6.0 devices (Torch). On older devices with 5.0 firmware jQuery mobile's UI widgets are essentially unusable - quite sluggish. For our application that is deployed on 9900 and 9700 devices we have taken a route to do custom development. You might be able to use jQuery core though.

JQuery Mobile, problem with loading form submitted pages

I'm working on a mobile view of our site. I'm trying to implement JQuery mobile but I'm seeing two issues that might prevent me from continuing and hoping some of you have insights.
Many pages are brought up by searches. But when the page is brought up from a search box I can't get it to load as rel='external', thus the page loads via Ajax. Great, except the pages that load are almost always larger pages broken up into data-role='page'. So when the page loads it's unable to navigate within that page, though it does hide the secondary sections. According to the documentation I need to put the rel="external" on the form, but that is not working for me. Is it possible to get the page to load without Ajax via a form submit?
Second question in same topic. In the crawl, walk, run fashion first step is a basic mobile friendly site. But I'm hoping this can also be the foundation for a PhoneGap based version of the site. From what I understand the basic model for PhoneGap will break if pages are not always loaded in Ajax as it will trigger a browser load. Since JQM requires any page with embeded data-role=page sections to be loaded via rel=external, which turns off Ajax loading, does this mean using JQM will preclude using Phone Gap to create the native client later?
Thanks in advance for any replies.
This script below should be put between your jquery min and your jquery mobile min. Otherwise it will not take effect. Adding an extension to the $.mobile with these ajax functionalities turned off may help your issue. All 3 are not needed, but they are all test worthy for your issue.
<script>
$(document).bind('mobileinit',function(){
$.extend( $.mobile , {
ajaxFormsEnabled: false,
ajaxLinksEnabled: false,
ajaxEnabled: false
});
});
</script>
Phonegap is for building phone applications, not mobile websites. It is composed Javascript which talks to specific libraries to interface with the mobile device itself.

Resources