# Rails Configuration: use Proc's or method overrides?

**URL:** <https://www.ruby-forum.com/t/rails-configuration-use-procs-or-method-overrides/185551>\
**Category:** Rails\
**Created:** [March 22, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/rails-configuration-use-procs-or-method-overrides/185551 "2010-03-22T17:38:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanwehner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/0ea827/32.png) [@stephanwehner](https://www.ruby-forum.com/u/stephanwehner)\
**Post date:** [March 22, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/rails-configuration-use-procs-or-method-overrides/185551/1 "2010-03-22T17:38:59Z")

</div>

I came across a ticket by Craig W. at

[https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4247-customising-asset-paths#ticket-4247-5](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4247-customising-asset-paths#ticket-4247-5)

and found it quite interesting.

Quote:  
This patch allows you to set the way that asset paths are rewritten. My  
own use case was to accommodate a server setup where not all of the  
assets have the same mtime even if they’re the same file.

If this is not set then it falls back to the default of using  
ENV[‘RAILS\_ASSET\_ID’] or the file mtime.

# config/environments/production.rb

# Normally you’d calculate RELEASE\_NUMBER at startup.

RELEASE\_NUMBER = 12345  
config.action\_controller.asset\_path\_template = proc { |asset\_path|  
“/release-#{RELEASE\_NUMBER}#{asset\_path}”  
}  
End Quote.

I feel it goes to the heart of Rails, namely, how should configuring an  
application be organized? In this case it seemed to me better to make  
use of Ruby method overrides.

At the same time, it would be good to have some uniformity with respect  
to configuration. Meaning when developing a patch like this, it would be  
good to have a guide.

What do you think?

Stephan
