Last Updated: February 25, 2016
·
654
· akosipc

Less generators with rails_admin gem

If you have a Rails application that has rails_admin and you want to use less as the default generator for stylesheet, you'll need to add this hack since railsadmin forces you're app to use scss, even if you have ```config.appgenerators.stylesheet_engine :lessdeclared in yourconfig/application.rb```

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