So after adding mobvious we can use method request.env[‘mobvious.device_type’] to get the current type of device i.e., desktop, tablet or mobile.

2) Now we have to set the variant in application_controller.rb

# app/application_controller.rbclassApplicationController<ActionController::Base# Prevent CSRF attacks by raising an exception.# For APIs, you may want to use :null_session instead.protect_from_forgerywith: :exception

4) Just create the views according to the format name. lets say we want to create index view for tablet we can create that view as index.html+tablet.erb which will be automatically detected by rails controller by default.

About Me

A few good Quotes

One isn’t necessarily born with courage, but one is born with potential. Without courage, we cannot practice any other virtue with consistency. We can’t be kind, true, merciful, generous, or honest.

Maya Angelou

When the highest type of people hear Tao (Truth), they diligently practice it. When the average type of people hear Tao, they half believe in it. When the lowest type of people hear Tao, they laugh at it. If they did not laugh, it would not be Tao.

Lao-Tzu

The human being is part of the whole, called by us the ‘universe’, a part limited in time and space. He experiences himself, his thoughts and feelings, as something separate from the rest — a kind of optical delusion of consciousness. This delusion is a kind of prison for us, restricting us to our personal desires. Our task must be to free ourselves from this prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty.

Albert Einstein

Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising which tempt you to believe that your critics are right. To map out a course of action and follow it to an end requires courage.