Home arrow Ruby-on-Rails arrow Page 3 - Ruby: Modules, Mixins, Fixins, and Rails
RUBY-ON-RAILS

Ruby: Modules, Mixins, Fixins, and Rails


Some time ago we discussed working with Ruby Objects and Classes. We are going to continue that discussion some more here, as we learn to work with Modules and Mixins. After that we will go over Rails and learn to create our first application with it.

Author Info:
By: James Payne
Rating: 2 stars2 stars2 stars2 stars2 stars / 13
April 21, 2008
TABLE OF CONTENTS:
  1. · Ruby: Modules, Mixins, Fixins, and Rails
  2. · A Few Notes
  3. · Going off the Rails of the Crazy Train
  4. · Controlling the Situation

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Ruby: Modules, Mixins, Fixins, and Rails - Going off the Rails of the Crazy Train
(Page 3 of 4 )

So far in my series of Ruby On Rails tutorials we've only touched upon Ruby (outside of installation at any rate). In the next few tutorials, we will be using Rails and learning the basics of web development with it.

Whereas Ruby is a programming language, Rails is more of a framework that uses Ruby to do its evil bidding, namely web application building. One of the primary functions of Rails is to build a skeleton application (with default information so there is no need to configure everything).

You should already have a directory created called “ruby.” If you don't, however, then type the following into your command prompt:


>md ruby

>cd ruby

Next we need to create the framework for our application. To do this, all you type in is rails followed by the name of your application. For this example we will type in: rails myfirsttime.

After you type this, your command prompt will go a little nuts, creating four billion files, as show below:

If you take a second and go to the directory where your Ruby is installed, you should see a folder named myfirsttime (unless you named your first rails application something else, in which case whatever you named it will be the folder name).

If you double-click onto that folder you should see something like this:


Inside of that folder you will notice a read-me file. If you open it, it will explain what each folder is used for. It isn't necessary to learn everything right this moment. Just be aware that the option is available to you.

To start the myfirsttime application, make sure you are in the myfirsttimedirectory:


>cd myfirsttime (note: do not type the “>”)


Next type:


>ruby script/server

The WEBrick will boot and you will see that your application has started on http://0.0.0.:3000. Go ahead and open up a web browser and type http://localhost:3000/ into your URL bar.

To end your WEBrick session press CTRL-C.

Now try going back to http://localhost:3000. It doesn't work right? That's because we ended the WEBrick session.


blog comments powered by Disqus
RUBY-ON-RAILS ARTICLES

- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form
- Ruby on Rails Templates and Layouts
- Action Pack Controller Creation
- Writing an Action Pack Controller

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials