/rails-with-multiple-jquery-ui-themes

Sample rails application with multiple jquery-ui themes

Primary LanguageRuby

Multiple jQuery-ui themes in rails

This sample rails application demonstrates how to add multiple jquery-ui themes and how to fine tune the asset pipeline.

Getting Started

  1. Checkout the code:

    git clone http://github.com:fpauser/rails-with-multiple-jquery-ui-themes.git
  2. Change directory to the just cloned sample rails app

    cd rails-with-multiple-jquery-ui-themes
    
  3. Bundle & Precompile Assets:

    bundle && bundle exec rake assets:clean assets:precompile
  4. Run in production:

    bundle exec rails s -e production
  5. Got to localhost:3000

Add further jquery-ui themes

  1. Go to jqueryui.com/themeroller/ and customize your theme.

  2. Click “Download theme” within the themeroller widget.

  3. Open the “Advanced Theme Settings” Area:

    • Specify the “CSS Scope” (e.g. ‘.my-theme’)

    • Specify the “Theme Folder Name” (e.g. ‘my-theme’)

  4. Download and unpack css/my-theme from the just downloaded theme archive to app/assets/stylesheets/jquery-ui-themes

  5. 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
    
  6. Precompile again and restart server:

    bundle exec rake assets:clean assets:precompile
    
    bundle exec rails s -e production

Note

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.