3

I want to include one theme folder https://github.com/usmanhalalit/charisma to my application.

As this document http://guides.rubyonrails.org/asset_pipeline.html#asset-organization , I clone the theme folder to the app/assets/charisma , and put

config.assets.paths << Rails.root.join("app", "assets", "charisma")

to my application config.

Then I create index.js and index.css on app/assets/charisma/:

/*
 *= require_tree .
*/


//= require_tree .

Then I add //= require charisma to my application.js , it gave error : couldn't find file 'charisma' when my application run

Muhammad Usman
  • 12,439
  • 6
  • 36
  • 59
why
  • 23,923
  • 29
  • 97
  • 142

2 Answers2

2

I think you should not add the new folder to assets paths . Just clone the repository to the vendor/assets/charisma or lib/assets/charisma and there create your index files .

R Milushev
  • 4,295
  • 3
  • 27
  • 35
1

At last I figured out of this. Actually I think there is an error in the documents at http://guides.rubyonrails.org/asset_pipeline.html#using-index-files . The index files should be named library_name.css instead of index.css(in your case create /vendor/assets/charisma/charisma.css), then in your application.css you can call //= require charisma .

Andy Wang
  • 378
  • 2
  • 8