user3382880
user3382880

Reputation: 33

How can load Controller Specific CSS and JS in Ruby On rails

In Rails project i am using Rails 5 version, Has i know controller specific css and js should load automatically without precompile the code in development mode.But if Precompile assets file than all controller specific files are loading.

 development.rb file
  Rails.application.configure do
    config.cache_classes = false
    config.eager_load = false
    config.consider_all_requests_local = true
     if Rails.root.join('tmp/caching-dev.txt').exist?
      config.action_controller.perform_caching = true
      config.cache_store = :memory_store
      config.public_file_server.headers = {
       'Cache-Control' => 'public, max-age=172800'
      }
    else
     config.action_controller.perform_caching = false
     config.cache_store = :null_store
    end  
  config.action_mailer.raise_delivery_errors = false
  config.action_mailer.perform_caching = false
  config.active_support.deprecation = :log
  config.active_record.migration_error = :page_load
  config.assets.debug = true
  config.assets.quiet = true
   config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

end

Upvotes: 0

Views: 131

Answers (1)

puneet18
puneet18

Reputation: 4427

try to make precompile false in development.rb file:

config.assets.compile = false

Upvotes: 0

Related Questions