This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tutorials:ruby_on_rails [2011/04/30 21:05] – [[[|Hello, world of Rails!]]] georg | tutorials:ruby_on_rails [2011/10/04 18:20] – Fix Formatting: Toc, <> memnon | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Content ===== | ===== Content ===== | ||
- | * [[#whatisrails|What is Rails?]] | + | * [[#What is Rails?]] |
- | * [[#prerequisites|Prerequisites]] | + | * [[# |
- | * [[#starting|Getting started]] | + | * [[#Getting started]] |
- | * [[#hello|Hello, world!]] | + | * [[#Hello, world of Rails!]] |
- | * [[#maintenance|Maintenance and Utility Scripts]] | + | * [[# |
---- | ---- | ||
- | ===== [[|What is Rails?]] ===== | + | ===== What is Rails? ===== |
[[http:// | [[http:// | ||
- | ===== [[|Prerequisites]] ===== | + | ===== Prerequisites ===== |
* You must be a MetaARPA member to use Rails (see [[http:// | * You must be a MetaARPA member to use Rails (see [[http:// | ||
Line 113: | Line 113: | ||
- or - | - or - | ||
$ ruby $HOME/ | $ ruby $HOME/ | ||
- | =& | + | => Booting WEBrick... |
- | =& | + | => Rails application started on http:// |
- | =& | + | => Ctrl-C to shutdown server; call with --help for options |
</ | </ | ||
- | Then point your browser at " | + | Then point your browser at " |
- | ===== [[|Hello, world of Rails!]] ===== | + | ===== Hello, world of Rails! ===== |
Rails is a Model-View-Controller framework. Rails accepts incoming requests from a browser, decodes the request to a controller, and calls an action method in that controller. The controller then invokes a particular view to display the results to the user. The good news is that Rails takes care of most of the internal plumbing that links all these actions. To write our simple Hello, World! application, | Rails is a Model-View-Controller framework. Rails accepts incoming requests from a browser, decodes the request to a controller, and calls an action method in that controller. The controller then invokes a particular view to display the results to the user. The good news is that Rails takes care of most of the internal plumbing that links all these actions. To write our simple Hello, World! application, | ||
Line 140: | Line 140: | ||
< | < | ||
- | class SayController | + | class SayController |
end | end | ||
</ | </ | ||
Line 149: | Line 149: | ||
< | < | ||
- | class SayController | + | class SayController |
def hello | def hello | ||
end | end | ||
Line 166: | Line 166: | ||
Save the file hello.rhtml, | Save the file hello.rhtml, | ||
- | ===== [[|Maintenance and Utility Scripts]] ===== | + | ===== Maintenance and Utility Scripts ===== |
There are currently two main scripts that MetaARPA members can run to manage their RoR instance. The first is //ror// which is used to toggle automatic startup of your RoR instance upon system boot. The second is // | There are currently two main scripts that MetaARPA members can run to manage their RoR instance. The first is //ror// which is used to toggle automatic startup of your RoR instance upon system boot. The second is // | ||
Line 180: | Line 180: | ||
// Note: if you do not see metaARPA here you're not in the metaARPA group and Rails won't work for you. | // Note: if you do not see metaARPA here you're not in the metaARPA group and Rails won't work for you. | ||
+ |