Ruby on Rails
Go to file
Dmytrii Nagirniak 8f003de2c7 fix minor spelling mistakes in comments 2011-05-23 22:40:29 -07:00
actionmailer Remove extra white spaces on ActionMailer docs. 2011-05-23 20:24:04 -03:00
actionpack fix minor spelling mistakes in comments 2011-05-23 22:40:29 -07:00
activemodel Remove extra white spaces on ActiveModel docs. 2011-05-23 20:39:10 -03:00
activerecord Remove extra white spaces on ActiveRecord docs. 2011-05-23 20:58:25 -03:00
activeresource active resource instalation instructions and Licence 2011-05-24 00:13:40 +05:30
activesupport Remove extra white spaces on ActiveSupport docs. 2011-05-23 21:00:45 -03:00
bin Add railties to the LOAD_PATH if running from a Rails checkout 2011-04-03 19:18:57 -03:00
ci more "SSL everywhere" for GitHub URLs 2011-03-07 06:18:32 +09:00
railties Removed extra white-spaces on config/environment/test.rb template 2011-05-23 22:38:02 -07:00
tasks adding a rake task to help generate changelog notes for release announcements 2011-04-18 14:44:12 -07:00
tools Support an extra profile printer arg 2010-06-24 01:08:12 -07:00
.gitignore (temporary hack) generate a main file for RDoc escaping "Rails" 2011-05-01 13:15:15 +02:00
.yardopts Let YARD document the railties gem 2010-09-09 18:24:34 -07:00
Gemfile Ensure Set-Cookie is not set on assets. 2011-05-17 17:44:06 -04:00
RAILS_VERSION Prepare for beta1 2011-05-04 20:21:05 -05:00
README.rdoc Update the MVC explanation in the main README.rdoc file 2011-05-23 21:09:05 -05:00
Rakefile (temporary hack) generate a main file for RDoc escaping "Rails" 2011-05-01 13:15:15 +02:00
install.rb Add install script for testing gems locally 2010-07-26 16:09:10 -05:00
load_paths.rb Remove rescue as it was clobbering the real error. 2011-04-15 18:43:21 +02:00
rails.gemspec default_executable is deprecated since rubygems 1.7.0 2011-04-01 23:58:37 -03:00
version.rb Prepare for beta1 2011-05-04 20:21:05 -05:00

README.rdoc

== Welcome to Rails

Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Controller pattern. 

Understanding the MVC pattern is key to understanding Rails.  MVC divides your application
into three layers, each with a specific responsibility.

The View layer is composed of "templates" that are responsible for providing 
appropriate representations of your application's resources.  Templates
can come in a variety of formats, but most view templates are HTML with embedded Ruby 
code (.erb files). 

The Model layer represents your domain model (such as Account, Product, Person, Post) 
and encapsulates the business logic that is specific to your application. In Rails, 
database-backed model classes are derived from ActiveRecord::Base. ActiveRecord allows
you to present the data from database rows as objects and embellish these data objects 
with business logic methods. Although most Rails models are backed by a database, models 
can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as
provided by the ActiveModel module. You can read more about Active Record in its
{README}[link:files/activerecord/README_rdoc.html].

The Controller layer handles incoming requests HTTP requests (such as Save New Account, 
Update Product, Show Post). Controllers are responsible for providing a suitable response
back to the client (usually a web browser, but possibly an JSON or XML API client, etc.).  
Controllers manipulate models and render the appropriate view templates to generate the HTTP response.

In Rails, the Controller and View layers are handled together by Action Pack.
These two layers are bundled in a single package due to their heavy interdependence. 
This is unlike the relationship between the Active Record and Action Pack which are
independent. Each of these packages can be used independently outside of Rails. You 
can read more about Action Pack in its {README}[link:files/actionpack/README_rdoc.html].

== Getting Started

1. Install Rails at the command prompt if you haven't yet:

    gem install rails

2. At the command prompt, create a new Rails application:

    rails new myapp

   where "myapp" is the application name.

3. Change directory to +myapp+ and start the web server:

    cd myapp; rails server

   Run with <tt>--help</tt> for options.

4. Go to http://localhost:3000/ and you'll see:

    "Welcome aboard: You're riding Ruby on Rails!"

5. Follow the guidelines to start developing your application. You may find the following resources handy:

* The README file created within your application.
* The {Getting Started with Rails}[http://guides.rubyonrails.org/getting_started.html].
* The {Ruby on Rails Tutorial}[http://railstutorial.org/book].
* The {Ruby on Rails Guides}[http://guides.rubyonrails.org].
* The {API Documentation}[http://api.rubyonrails.org].


== Contributing

We encourage you to contribute to Ruby on Rails! Please check out the {Contributing to Rails
guide}[http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how
to proceed. {Join us}[http://contributors.rubyonrails.org]!

== License

Ruby on Rails is released under the MIT license.