Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.1ruby-on-rails-3.2responsive-design

make me clear for Desktop and mobile view websites


when we develop a website is it also perfect for mobile view? if not then what changes requires if i want to develop for both desktop view and mobile view? please give me suggestions...


Solution

  • Most of the desktop/small device browser's (client) send their device info in request header.

    A server should recognize that. If it can recognize it can process the request as normal flow and delegate to proper/expected view.

    One example flow can be like this:

    Client - Deice: Android - Resolution: AxY - URL: URL of the resource to GET

    Server: - I can recognize the device - I am preparing relevant UI for that device (html/jsp/php etc) - I have the resource for given URL - I am preparing the request and sending it


    Additionally Refer to Sterloks answer. That thing can guide you to prepare the view.

    However most important part is to recognize the device (actually client) and respond accordingly.

    For example, a Java EE based web-application can achieve this using a Request Filter.