Next step : Creating the database for the filename application
The next phase or step would be to create a database for the application to use. Make sure the MySql engine is running and in the command window type “mysql -u root -p” and press enter and another enter for the password when prompted for there has not been any defined password yet. You are now logged into the engine as the root user and proceed to create the database by entering the following command “create database filename_development”. Also type in “grant all on filename_development.* to ‘ODBC’@'localhost’ this tells windows to grant access to a user named ODBC so you avoid an error when you try to access the said database from the command prompt. We next tackle the creation of tables that would allow the database to store the information we send it.
Database manipulation
The database has been initialized, so now we get down to business of defining the fields in that database and include a field that we would call a foreign key which allows the establishment of the one to many relationship between the tables. This part of the process requires quite a bit of background of database creation, manipulation and handling. It also requires knowledge regarding the workings of data types. So assuming you do not have much knowledge in such areas do some more reading to give you a better understanding of what how and why they are there. The ROR developers might say that it is very easy to do and use ROR but without the background on logic formulation, data types and manipulation as well as database handling the rest of the posts which would tackle ever hardening topics and operations would be very difficult to make sense of.
Don’t get me wrong, we just want to make life easier for you and not have you not understanding anything at all.
Next Step : Creating Empty Applications
Now that all has been set-up and is working, you should be able to create empty apps which is merely defining the application using rails which automatically creates all the necessary directories that are needed. Open a command prompt window and go to the directory where it was installed and proceed into the rails_apps directory. Type in ‘rails filename’ and rails creates all the necessary directories you would be needing for the development process. Don�t get freaked out when you see the multitude of directories for they will be filled out by “RAILS” and not by you manually. The next post will discuss some of the nuances of those dizzying directories to take some of the fog over them out.
Necessity for a Hash Key

Image Source: www.cheat-sheets.org
The only restriction for a hash key is that it must reply to the message hash with a hash value, and the hash value for a given key must not alter. This means that certain classes (such as Array and Hash, as of this writing) can’t conveniently be used as keys, because their hash values can change based on their contents.
If you keep an external reference to an object that is used as a key, and use that reference to alter the object and change its hash value, the hash lookup based on that key may not work.
Because strings are the most frequently used keys, and because string contents are often altered, Ruby treats string keys specially. If you use a String object as a hash key, the hash will replace the string internally and will use that duplicate as its key. Any changes afterward made to the original string will not influence the hash.
If you write your own classes and use instances of them as hash keys, you need to make sure that either (a) the hashes of the key objects don’t change once the objects have been created or (b) you bear in mind to call the Hash#rehash method to reindex the hash whenever a key hash is altered.
Before You Start
Assuming you have even just a little background in programming with any language there are four basic programs and extensions that you need but are provided by the quick installers you’ve just downloaded to your hard drive. You have The Ruby programming language program files, the Rails part of the programming extension/platform, MySql or your database query handling system and the Apache which is a web server that you use to emulate your application’s execution on the web. Granting you have these set up properly and tested (instructions for which are included in the installer package). You can now start building your first application with RoR.
RoR Application Directories in-depth
There are quite a number of directories locate in the apps folder we have just created so to de-mystify them here are some explanations which hopefully would help you out. The directory “app/controllers” is where Rails searches for the controller classes which controls the web request from the user. The next one is the, “app/views” folder which houses the templates to which the data from the app is converted to HTML and then returned to the user’s browser. The next folder houses the “apps/models” subdirectory which contains the data classes that wraps the data stored within the application’s database (this is the messiest part of the framework in other frameworks). Then last of the vital sub-directories is the “app/helpers” which hold the helper classes of data that assists the view, model and controller classes keeping them small, organized and focused on the task it is supposed to do in the first place.




