ruby on rails - How do I add timezone configuration to my environment.rb file? -


first, difference between configuring in application.rb file vs. environment.rb file?

i read need configure timezone default in environment.rb file. not quite sure how though. far have in environment.rb file:

# load rails application require file.expand_path('../application', __file__)  # initialize rails application sampleapp::application.initialize! 

do need rerun rails server after make changes? additional steps?

thanks!

in rails 2, environment.rb had configuration. in rails 3 it's changed application.rb, environment/production.rb , environment/development.rb, , gemfile. configure timezone, put in application.rb in application class:

class application < rails::application   config.time_zone = 'eastern time (us & canada)' end 

you can run rake time:zones:all see list of available timezones.

edit in rails 3 don't need touch environment.rb.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -