Brings the excellent Framework7 into the Rails 3.1.x - 4.x Asset Pipeline.
The gem version number x.y.z
is kept in sync with the version of Framework7
being supported.
Add this line to your application's Gemfile:
gem 'framework7-rails'
If you want bleeding edge, not yet in ruby gems version, add this instead:
gem 'framework7-rails', :git => 'https://github.com/twss/framework7-rails.git'`
And then execute:
$ bundle
Or, install it yourself as:
$ gem install framework7-rails
The easiest way to set up ready for use is to use the generator
$ rails g f7:install
You can do it manually if you want to, as outlined below:
In your application.js file, add the line:
//= require framework7
In your application.css file, add the line:
*= require framework7
*= require framework7.themes
This generator will add the necessary require statements as outlined above.
This sets up an application-level layout, and will generate two files:
app/assets/javascripts/<app_name>.js or app/assets/javascripts/<app_name>.coffee
app/views/layouts/application.html.erb
For now, at least, the javascript generated has been scaled back, to be:
window.F7H = {
app: new Framework7(),
dom: Dom7
};
window.Phone = {
Views: {}
};
Phone.Views.Main = F7H.app.addView('.view-main', {
dynamicNavbar: true
});
Removed, as they didn't really add anything of value.
To find out about the rest of the generators, be sure to check out the wiki, which will be updated as more become available.
Refer to the wiki for the usage/documentation.
In the immediate future we'd like to:
- Make the code a bit more DRY.
- Move all the grunt work out of the helpers, into Presenters/Decorators.
- Add javascript generation for the more dynamic elements.
- Fork it http://github.com/twss/framework7-rails/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 new Pull Request.