OpenInApp Rails Plugin
Adds support to redirect specific URLs to their mobile app equivalents
Installation
Add this line to your application's Gemfile:
gem 'rails-open-in-app', require: 'open_in_app'
And then execute:
$ bundle
Usage
In the controllers you want to redirect to your mobile app, call open_in_app
:
open_in_app :only => :show
Then implement open_in_app_url
to return the correct URL to open the app:
def open_in_app_url
"scoutmobshoppe://products/#{params[:id]}
end
Contributing
- Fork it ( https://github.com/Scoutmob/rails-open-in-app/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