development.rb:
config.action_controller.asset_host = "assets.myserver.com"
view script:
<%= image_tag('header.jpg') %>
yields:
<img alt="Header" src="/header.jpg" />
should be:
<img alt="Header" src="http://assets.myserver.com/header.jpg" />
I am using the rails-api gem which I am guessing disables some asset and view rendering stuff.
It seems like it should not be too hard to re-implement (override image_tag) to add this very small feature. It may seem a little odd to want to do this. However, I am new-ish to rails would like to know how to do this as a learning experience.
Questions:
- As a best practice where should I place this new code in the file structure?
- What should I name the file with the new code?
- How does rails know to look at the new code instead of looking at the old image_tag function?