Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 74 lines (49 sloc) 3.302 kb
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
1 == Welcome to Rails
b70062f @josevalim Rework a bit README files.
josevalim authored
2
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
3 Rails is a web-application framework that includes everything needed to create
3e29f6a @bratish Added acronym and reference link for Model–view–controller
bratish authored
4 database-backed web applications according to the {Model-View-Controller (MVC)}[http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller] pattern.
5
5b51e58 @htanata Fix two spaces between sententes on README.rdoc.
htanata authored
6 Understanding the MVC pattern is key to understanding Rails. MVC divides your application
3e29f6a @bratish Added acronym and reference link for Model–view–controller
bratish authored
7 into three layers, each with a specific responsibility.
8
9 The View layer is composed of "templates" that are responsible for providing
5b51e58 @htanata Fix two spaces between sententes on README.rdoc.
htanata authored
10 appropriate representations of your application's resources. Templates
d3d2cea @vijaydev doc fixes
vijaydev authored
11 can come in a variety of formats, but most view templates are \HTML with embedded Ruby
3e29f6a @bratish Added acronym and reference link for Model–view–controller
bratish authored
12 code (.erb files).
13
14 The Model layer represents your domain model (such as Account, Product, Person, Post)
15 and encapsulates the business logic that is specific to your application. In Rails,
d3d2cea @vijaydev doc fixes
vijaydev authored
16 database-backed model classes are derived from ActiveRecord::Base. Active Record allows
3e29f6a @bratish Added acronym and reference link for Model–view–controller
bratish authored
17 you to present the data from database rows as objects and embellish these data objects
18 with business logic methods. Although most Rails models are backed by a database, models
19 can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as
20 provided by the ActiveModel module. You can read more about Active Record in its
20333be @tilsammans fix broken relative links [#5415 state:committed]
tilsammans authored
21 {README}[link:files/activerecord/README_rdoc.html].
b70062f @josevalim Rework a bit README files.
josevalim authored
22
7e65b00 @vijaydev Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
vijaydev authored
23 The Controller layer is responsible for handling incoming HTTP requests and providing a
d3d2cea @vijaydev doc fixes
vijaydev authored
24 suitable response. Usually this means returning \HTML, but Rails controllers can also
7e65b00 @vijaydev Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
vijaydev authored
25 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers manipulate models
26 and render view templates in order to generate the appropriate HTTP response.
b70062f @josevalim Rework a bit README files.
josevalim authored
27
7e65b00 @vijaydev Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
vijaydev authored
28 In Rails, the Controller and View layers are handled together by Action Pack.
29 These two layers are bundled in a single package due to their heavy interdependence.
f21e8e0 @waynn Superfluous "the".
waynn authored
30 This is unlike the relationship between Active Record and Action Pack which are
7e65b00 @vijaydev Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
vijaydev authored
31 independent. Each of these packages can be used independently outside of Rails. You
32 can read more about Action Pack in its {README}[link:files/actionpack/README_rdoc.html].
b70062f @josevalim Rework a bit README files.
josevalim authored
33
34 == Getting Started
35
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
36 1. Install Rails at the command prompt if you haven't yet:
d3819da @fxn README.rdoc is your first impression, make sure it is clean
fxn authored
37
f7f5299 @fxn use the same amount of left indent in all code blocks of README.rdoc
fxn authored
38 gem install rails
b70062f @josevalim Rework a bit README files.
josevalim authored
39
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
40 2. At the command prompt, create a new Rails application:
b70062f @josevalim Rework a bit README files.
josevalim authored
41
b451de0 @spastorino Deletes trailing whitespaces (over text files only find * -type f -ex…
spastorino authored
42 rails new myapp
d3819da @fxn README.rdoc is your first impression, make sure it is clean
fxn authored
43
44 where "myapp" is the application name.
45
46 3. Change directory to +myapp+ and start the web server:
47
48 cd myapp; rails server
49
50 Run with <tt>--help</tt> for options.
b70062f @josevalim Rework a bit README files.
josevalim authored
51
e231c49 @bratish '/' was outside of anchor tag.
bratish authored
52 4. Go to http://localhost:3000 and you'll see:
d3819da @fxn README.rdoc is your first impression, make sure it is clean
fxn authored
53
f7f5299 @fxn use the same amount of left indent in all code blocks of README.rdoc
fxn authored
54 "Welcome aboard: You're riding Ruby on Rails!"
b70062f @josevalim Rework a bit README files.
josevalim authored
55
d3dce77 Edited README.rdoc via GitHub
Oge Nnadi authored
56 5. Follow the guidelines to start developing your application. You may find the following resources handy:
b70062f @josevalim Rework a bit README files.
josevalim authored
57
d3819da @fxn README.rdoc is your first impression, make sure it is clean
fxn authored
58 * The README file created within your application.
5e0b70e @fxn revises a few link texts
fxn authored
59 * The {Getting Started with Rails}[http://guides.rubyonrails.org/getting_started.html].
60 * The {Ruby on Rails Tutorial}[http://railstutorial.org/book].
5cefa00 @vijaydev removed dup link to 'getting started'
vijaydev authored
61 * The {Ruby on Rails Guides}[http://guides.rubyonrails.org].
62 * The {API Documentation}[http://api.rubyonrails.org].
b70062f @josevalim Rework a bit README files.
josevalim authored
63
64
65 == Contributing
66
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
67 We encourage you to contribute to Ruby on Rails! Please check out the {Contributing to Rails
7e65b00 @vijaydev Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
vijaydev authored
68 guide}[http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how
d3819da @fxn README.rdoc is your first impression, make sure it is clean
fxn authored
69 to proceed. {Join us}[http://contributors.rubyonrails.org]!
b70062f @josevalim Rework a bit README files.
josevalim authored
70
71 == License
72
e68b7a0 @fxn (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
73 Ruby on Rails is released under the MIT license.
Something went wrong with that request. Please try again.