ruby on rails 3.2 changing the default assets path from /asset to someother directory
I have been working on rails 3.0.9 earlier and tried moving to rails 3.2 for the same project. I added following to my Gem file:
gem 'rails', '3.2.3' gem 'nokogiri' gem 'rack', "~>1.1" group :assets do gem 'sass-rails', "~> 3.2.3" gem 'coffee-rails', "~> 3.2.1" gem 'uglifier', '>=1.0.3' end
I added following to applcation.rb
config.assets.enabled = true config.assets.version = '1.0' config.assets.prefix = "/public"
But somehow the changing of the prefix is not working.It's always picking the path as /assets.
When i do rails c and type: Rails.application.config.assets.paths
it's always giving me the result as if it's picking the path from /assets.
Can anybody help me with this. Thanks.
config.assets.manifest = '/path/to/some/other/location'
Setting config.assets.prefix just tells sprokets where to store precompiled assets. By default, this is public/assets. I think what you are attempting to do is change the search path (where sprokets looks for your raw assets). In general, you can add to the search path with config.assets.paths << Rails.root.join("app", "assets", "special") for example. But @Zajn is correct that you should place your raw assets in app/assets to conform to the rails asset pipeline conventions.
I agree with Zajin in the Comments of your Question. Conforming to the new start not only rocks out loud but makes a lot of things easier when it comes to running things in production.
I would highly recommend watching these awesome Railscasts.com video:
It is for upgrading to 3.1 and then for upgrading to 3.2, so watch them both first and then follow them to conform to the new standards. He is the best when it comes to seeing what the new versions of rails has to offer.
He also goes on to explain a lot of what rails 3.1 has to offer here:
Its a beta video but it will help you get excited about, especially his video that goes over sass and coffee script.
I know its not the answer you were looking for and it seems like more work to comply with the newer standards but it will only make things easier in the future.