Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the application.rb file located?

Im new to Ruby On Rails.Im using Ruby version 1.8.7 and Rails version 2.3.8.I created a controller SayHello using

ruby script/generate controller SayHello

The application works as expected, but i cant find the application.rb file. Where is the application.rb file located ?

Please Help Thank You

like image 270
Jim Avatar asked Sep 05 '10 11:09

Jim


People also ask

What is the purpose of environment RB and application RB files?

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. The purpose of this file is to configure things for the whole application like encoding.

How do I use an RB file?

Because RB files are XML files, you can open and edit them in any text editor, including: Microsoft Notepad (Windows) Apple TextEdit (Mac)

What is a Rails application?

Rails is a web application development framework written in the Ruby programming language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks.

What does require do in Rails?

require can also be used to load only a part of a gem, like an extension to it. Then it is of course required where the configuration is. You might be concerned if you work in a multi-threaded environment, as they are some problems with that. You must then ensure everything is loaded before having your threads running.


2 Answers

I assume you're looking for the application controller which was named application.rb prior to rails 2.3 but is since application_controller.rb.

http://guides.rubyonrails.org/2_3_release_notes.html#application-controller-renamed

controllers>application_controller.rb

like image 64
mark Avatar answered Oct 06 '22 00:10

mark


This file is new to rails 3, in rails 2 most of the things now in application.rb are in the environment.rb.

like image 23
jigfox Avatar answered Oct 06 '22 00:10

jigfox