Adding a path to assets for Rails 3.1.2

Referring to http://guides.rubyonrails.org/asset_pipeline.html it says:

- - - -
You can add additional (fully qualified) paths to the pipeline in
config/application.rb. For example:
config.assets.paths << Rails.root.join("app", "assets", "flash")
- - - -

I did that but when I look at
  Rails.application.config.assets.paths
later in the code, the path to app/assets/flash has disappeared.

What's the right way to add a path to assets?

Monday, December 26, 2011, 1:17:14 PM, you wrote:

Referring to http://guides.rubyonrails.org/asset_pipeline.html it says:

- - - -
You can add additional (fully qualified) paths to the pipeline in
config/application.rb. For example:
config.assets.paths << Rails.root.join("app", "assets", "flash")
- - - -

I did that but when I look at
  Rails.application.config.assets.paths
later in the code, the path to app/assets/flash has disappeared.

What's the right way to add a path to assets?

--
Posted via http://www.ruby-forum.com/.

I'll answer my own question.

The documentation is wrong.

Instead create a file (an initializer) in config\initializers. I called mine
  add_to_asset_paths.rb

My config\initializers\add_to_asset_paths.rb looks like
- - - - -
# Ralph: http://guides.rubyonrails.org/asset_pipeline.html is wrong
Rails.application.config.assets.paths << (Rails.root.join("app", "assets", "flash")).to_s
- - - - -

I hope this saves someone else from pulling their hair out.

Monday, December 26, 2011, 3:45:08 PM, you wrote:

Monday, December 26, 2011, 1:17:14 PM, you wrote:

Referring to http://guides.rubyonrails.org/asset_pipeline.html it says:

- - - -
You can add additional (fully qualified) paths to the pipeline in
config/application.rb. For example:
config.assets.paths << Rails.root.join("app", "assets", "flash")
- - - -

I did that but when I look at
  Rails.application.config.assets.paths
later in the code, the path to app/assets/flash has disappeared.

What's the right way to add a path to assets?

--
Posted via http://www.ruby-forum.com/.

I'll answer my own question.

The documentation is wrong.

Instead create a file (an initializer) in config\initializers. I called mine
  add_to_asset_paths.rb

My config\initializers\add_to_asset_paths.rb looks like
- - - - -
# Ralph: http://guides.rubyonrails.org/asset_pipeline.html is wrong
Rails.application.config.assets.paths << (Rails.root.join("app", "assets", "flash")).to_s
- - - - -

I hope this saves someone else from pulling their hair out.

I'd like to push a documentation change but given that I am clueless how to do it and don't want to go through the learning curve myslef, if someone wants to give me a hand showing me how, I'd sure like to learn.

Monday, December 26, 2011, 3:45:08 PM, you wrote:

Monday, December 26, 2011, 1:17:14 PM, you wrote:

Referring to http://guides.rubyonrails.org/asset_pipeline.html it says:

- - - -
You can add additional (fully qualified) paths to the pipeline in
config/application.rb. For example:
config.assets.paths << Rails.root.join("app", "assets", "flash")
- - - -

I did that but when I look at
  Rails.application.config.assets.paths
later in the code, the path to app/assets/flash has disappeared.

What's the right way to add a path to assets?

--
Posted via http://www.ruby-forum.com/.

I'll answer my own question.

The documentation is wrong.

Instead create a file (an initializer) in config\initializers. I called mine
  add_to_asset_paths.rb

My config\initializers\add_to_asset_paths.rb looks like
- - - - -
# Ralph: http://guides.rubyonrails.org/asset_pipeline.html is wrong
Rails.application.config.assets.paths << (Rails.root.join("app", "assets", "flash")).to_s
- - - - -

I hope this saves someone else from pulling their hair out.

I'll add another issue to this.

It appears that if the path is of the form
  vendor\bundle\ruby\1.9.1\gems\jw_player_helper-0.0.1\assets\javascripts

(that is, the append looks like this:)

  Rails.application.config.assets.paths <<
    (Rails.root.join("app", "vendor","bundle","ruby","1.9.1","gems","jw_player_helper-0.0.1","assets", "javascripts")).to_s

that the asset manager (sprockets?) won't find
  c:\RailsInstaller\Sites\ultradedup002\vendor\bundle\ruby\1.9.1\gems\jw_player_helper-0.0.1\assets\javascripts\swfobject.js
when you do a
  - javascript_include_tag('swfobject.js')
in your view.

Monday, December 26, 2011, 4:54:22 PM, you wrote:

Monday, December 26, 2011, 3:45:08 PM, you wrote:

Monday, December 26, 2011, 1:17:14 PM, you wrote:

Referring to http://guides.rubyonrails.org/asset_pipeline.html it says:

- - - -
You can add additional (fully qualified) paths to the pipeline in
config/application.rb. For example:
config.assets.paths << Rails.root.join("app", "assets", "flash")
- - - -

I did that but when I look at
  Rails.application.config.assets.paths
later in the code, the path to app/assets/flash has disappeared.

What's the right way to add a path to assets?

--
Posted via http://www.ruby-forum.com/.

I'll answer my own question.

The documentation is wrong.

Instead create a file (an initializer) in config\initializers. I called mine
  add_to_asset_paths.rb

My config\initializers\add_to_asset_paths.rb looks like
- - - - -
# Ralph: http://guides.rubyonrails.org/asset_pipeline.html is wrong
Rails.application.config.assets.paths << (Rails.root.join("app", "assets", "flash")).to_s
- - - - -

I hope this saves someone else from pulling their hair out.

I'll add another issue to this.

It appears that if the path is of the form
  vendor\bundle\ruby\1.9.1\gems\jw_player_helper-0.0.1\assets\javascripts

(that is, the append looks like this:)

  Rails.application.config.assets.paths <<
    (Rails.root.join("app", "vendor","bundle","ruby","1.9.1","gems","jw_player_helper-0.0.1","assets", "javascripts")).to_s

that the asset manager (sprockets?) won't find
  c:\RailsInstaller\Sites\ultradedup002\vendor\bundle\ruby\1.9.1\gems\jw_player_helper-0.0.1\assets\javascripts\swfobject.js
when you do a
  - javascript_include_tag('swfobject.js')
in your view.

Never mind. I'm probably wrong on this last point.