Separation
Separation renders separate views depending on the user device type for Rails. This feature is realized by Action Pack Variants.
Installation
Add this line to your application's Gemfile:
gem 'separation'And then execute:
$ bundle
Usage
Once you added to Gemfile, you can use specific views depending on the user device type, such as phone, tablet, and desktop.
The relation between user device type and file name is as follows:
| User Device Type | File Name Example | Device Example |
|---|---|---|
| Phone | show.html+phone.erb | iPhone, Android |
| Tablet | show.html+tablet.erb | iPad, Android Tablet |
| Desktop | show.html+desktop.erb | PC |
| (Default) | show.html.erb | - |
If you don't prepare specific view, Rails application renders default view (e.g. show.html.erb).
Contributing
- Fork it ( https://github.com/kami-zh/separation/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request