This sample rails application demonstrates how to add multiple jquery-ui themes and how to fine tune the asset pipeline.
-
Checkout the code:
git clone http://github.com:fpauser/rails-with-multiple-jquery-ui-themes.git
-
Change directory to the just cloned sample rails app
cd rails-with-multiple-jquery-ui-themes
-
Bundle & Precompile Assets:
bundle && bundle exec rake assets:clean assets:precompile
-
Run in production:
bundle exec rails s -e production
-
Got to localhost:3000
-
Go to jqueryui.com/themeroller/ and customize your theme.
-
Click “Download theme” within the themeroller widget.
-
Open the “Advanced Theme Settings” Area:
-
Specify the “CSS Scope” (e.g. ‘.my-theme’)
-
Specify the “Theme Folder Name” (e.g. ‘my-theme’)
-
-
Download and unpack
css/my-theme
from the just downloaded theme archive toapp/assets/stylesheets/jquery-ui-themes
-
Add the new themes path to
config/application.rb
:config.assets.paths.unshift Rails.root.join("app", "assets", "stylesheets", "jquery-ui-themes", "my-theme").to_s
-
Precompile again and restart server:
bundle exec rake assets:clean assets:precompile bundle exec rails s -e production
For “real” production use behinde apache or even better nginx don’t forget to change the production environment setting config.serve_static_assets
from true
to false
.