Supports settings of page specified assets load and precompile at Ruby on Rails.
In config/application.rb
require "kyubi/railtie"
In app/views/layout/application.html.erb
<%= kyubi_stylesheet_link_tag media: 'all' %>
<%= kyubi_javascript_include_tag 'data-turbolinks-track' => 'reload' %>
Kyubi expects app/assets/views
directory has same structures with app/views
directory.
app
+-- assets
+-- stylesheets
+-- javascripts
+-- views
+-- top
+-- shared.css
+-- index.css
+-- index.js
+-- views
+-- top
+-- index.html.erb
when top/index view rendering, index.css and index.js are loaded by kyubi tag helper.
โป shared
is also loaded when execute same controller action.
Add this line to your application's Gemfile:
gem 'kyubi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kyubi
The gem is available as open source under the terms of the MIT License.