Skip to content

Instantly share code, notes, and snippets.

@meltedice
Created November 22, 2013 07:59
Show Gist options
  • Save meltedice/7596416 to your computer and use it in GitHub Desktop.
Save meltedice/7596416 to your computer and use it in GitHub Desktop.
rails 4.0.1 + rails_admin 0.5.0 (sass-rails 4.0.1) + less-rails 2.4.2 sass-rails will overwrite stylesheet_engine setting in config/application.rb via initializer hook. So rails g scaffold and other generators use :scss instead of :less Force set :less as stylesheet_engine via initializer hook to use :less.
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Less
module Rails
class Railtie
initializer 'less-rails.force-set-stylesheet_engine.after-setup_sass', after: :setup_sass, group: :all do |app|
config.app_generators.stylesheet_engine :less
end
end
end
end
module MyApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.app_generators.stylesheet_engine :less
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment