Ruby On Rails Interviewfragen und Antworten
Question: What is the purpose of Environment.RB and Application.RB in Ruby on Rails?Answer:There are two files where variables and configuration settings are stored. - config/environment.rb : Environment settings go here - config/application.rb : Application level global settings go here config.time_zone = 'Central Time (US & Canada)' config.i18n.default_locale = :de config.filter_parameters += [:password] # ensures that passwords are not logged The same file is also used for configuring various environment settings such as: config.action_mailer.smtp_settings # various email settings go here What is the purpose of config/environments/development.rb file? You would specify various config settings the development environment in this file. config.action_controller.perform_caching = false # to enable caching This is because you typically do not want to enable caching in the development environment. The same config setting in the production environment would be equal to true. |
Zum Wiederholen speichern
Speichere diesen Eintrag als Lesezeichen, markiere ihn als schwierig oder lege ihn in einem Wiederholungsset ab.
Melde dich an, um Lesezeichen, schwierige Fragen und Wiederholungssets zu speichern.
Am hilfreichsten laut Nutzern:
- What is Ruby On Rails?
- Why Ruby on Rails?
- Explain how (almost) everything is an object in Ruby.
- What are Gems and which are some of your favorites?
- How would you declare and use a constructor in Ruby?