I am new to Rails and I have good knowledge of ASP.net. In ASP.net web applications I have one web.config
to do all my settings, but in Rails there are several config files and I would like to know now, what are the differences between them and what is the purpose of these files are.
Basically the different config files build together the web.config
as you know it from ASP.net.
environment.rb
Rails has different run-levels, like ASP.net has it's environments too. In the environment.rb
file you configure these run-levels. For example, you could use it to have some special settings for your development stage, which are usefull for debugging.
application.rb
The purpose of this file is to configure things for the whole application like encoding.
You can find some more information in the guide, like it was mentioned by davids.
From the guides:
config/environment.rb
This file is the common file required by config.ru (rails server) and Passenger. This is where these two ways to run the server meet; everything before this point has been Rack and Rails setup.
This file begins with requiring config/application.rb.
config/application.rb
This file requires config/boot.rb, but only if it hasn’t been required before, which would be the case in rails server but wouldn’t be the case with Passenger.
Then the fun begins!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With