Skip to content

Commit 7043a5f

Browse files
committed
Update README with the rail and the ruby-saml version supported.
1 parent 647433a commit 7043a5f

File tree

1 file changed

+96
-73
lines changed

1 file changed

+96
-73
lines changed

README

Lines changed: 96 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
== Welcome to Rails
1+
Welcome to the ruby-saml project example for Rails2 / Rails3
2+
============================================================
23

34
Rails is a web-application framework that includes everything needed to create
45
database-backed web applications according to the Model-View-Control pattern.
@@ -25,7 +26,13 @@ Rails. You can read more about Action Pack in
2526
link:files/vendor/rails/actionpack/README.html.
2627

2728

28-
== Getting Started
29+
Supported Version
30+
-----------------
31+
32+
This ruby-saml-example project works with rails2 and rails3 and uses is compatible with the ruby-saml toolkit < 0.7.3.
33+
34+
Getting Started
35+
---------------
2936

3037
1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
3138
and your application name. Ex: rails myapp
@@ -34,7 +41,8 @@ link:files/vendor/rails/actionpack/README.html.
3441
4. Follow the guidelines to start developing your application
3542

3643

37-
== Web Servers
44+
Web Servers
45+
-----------
3846

3947
By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
4048
with a variety of other web servers.
@@ -48,51 +56,59 @@ Say other Ruby web servers like Thin and Ebb or regular web servers like Apache
4856
Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
4957
FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
5058

51-
== Apache .htaccess example for FCGI/CGI
59+
Apache .htaccess example for FCGI/CGI
60+
-------------------------------------
5261

53-
# General Apache options
54-
AddHandler fastcgi-script .fcgi
55-
AddHandler cgi-script .cgi
56-
Options +FollowSymLinks +ExecCGI
62+
**General Apache options**
63+
```
64+
AddHandler fastcgi-script .fcgi
65+
AddHandler cgi-script .cgi
66+
Options +FollowSymLinks +ExecCGI
67+
```
5768

58-
# If you don't want Rails to look in certain directories,
59-
# use the following rewrite rules so that Apache won't rewrite certain requests
60-
#
61-
# Example:
62-
# RewriteCond %{REQUEST_URI} ^/notrails.*
63-
# RewriteRule .* - [L]
69+
If you don't want Rails to look in certain directories,
70+
use the following rewrite rules so that Apache won't rewrite certain requests
71+
72+
Example:
73+
```
74+
RewriteCond %{REQUEST_URI} ^/notrails.*
75+
RewriteRule .* - [L]
76+
```
6477

65-
# Redirect all requests not available on the filesystem to Rails
66-
# By default the cgi dispatcher is used which is very slow
67-
#
68-
# For better performance replace the dispatcher with the fastcgi one
69-
#
70-
# Example:
71-
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
72-
RewriteEngine On
78+
Redirect all requests not available on the filesystem to Rails
79+
By default the cgi dispatcher is used which is very slow
80+
81+
For better performance replace the dispatcher with the fastcgi one
7382

74-
# If your Rails application is accessed via an Alias directive,
75-
# then you MUST also set the RewriteBase in this htaccess file.
76-
#
77-
# Example:
78-
# Alias /myrailsapp /path/to/myrailsapp/public
79-
# RewriteBase /myrailsapp
83+
Example:
84+
```
85+
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
86+
RewriteEngine On
8087

81-
RewriteRule ^$ index.html [QSA]
82-
RewriteRule ^([^.]+)$ $1.html [QSA]
83-
RewriteCond %{REQUEST_FILENAME} !-f
84-
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
88+
If your Rails application is accessed via an Alias directive,
89+
then you MUST also set the RewriteBase in this htaccess file.
8590

86-
# In case Rails experiences terminal errors
87-
# Instead of displaying this message you can supply a file here which will be rendered instead
88-
#
89-
# Example:
90-
# ErrorDocument 500 /500.html
91+
Example:
92+
```
93+
Alias /myrailsapp /path/to/myrailsapp/public
94+
RewriteBase /myrailsapp
95+
96+
RewriteRule ^$ index.html [QSA]
97+
RewriteRule ^([^.]+)$ $1.html [QSA]
98+
RewriteCond %{REQUEST_FILENAME} !-f
99+
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
100+
``
101+
In case Rails experiences terminal errors, Instead of displaying this message you can supply a file here which will be rendered instead.
91102

92-
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
103+
Example:
104+
```
105+
ErrorDocument 500 /500.html
93106

107+
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
108+
```
94109

95-
== Debugging Rails
110+
Debugging Rails
111+
---------------
96112

97113
Sometimes your application goes wrong. Fortunately there are a lot of tools that
98114
will help you debug it and get it back on the rails.
@@ -104,19 +120,19 @@ browser on requests from 127.0.0.1.
104120

105121
You can also log your own messages directly into the log file from your code using
106122
the Ruby logger class from inside your controllers. Example:
107-
123+
```
108124
class WeblogController < ActionController::Base
109125
def destroy
110126
@weblog = Weblog.find(params[:id])
111127
@weblog.destroy
112128
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
113129
end
114130
end
115-
131+
```
116132
The result will be a message in your log file along the lines of:
117-
133+
```
118134
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
119-
135+
```
120136
More information on how to use the logger is at http://www.ruby-doc.org/core/
121137

122138
Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
@@ -128,41 +144,50 @@ These two online (and free) books will bring you up to speed on the Ruby languag
128144
and also on programming in general.
129145

130146

131-
== Debugger
147+
Debugger
148+
--------
132149

133150
Debugger support is available through the debugger command when you start your Mongrel or
134151
Webrick server with --debugger. This means that you can break out of execution at any point
135152
in the code, investigate and change the model, AND then resume execution!
136153
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
154+
137155
Example:
138156

157+
```
139158
class WeblogController < ActionController::Base
140159
def index
141160
@posts = Post.find(:all)
142161
debugger
143162
end
144163
end
164+
```
145165

146166
So the controller will accept the action, run the first line, then present you
147167
with a IRB prompt in the server window. Here you can do things like:
148168

169+
```
149170
>> @posts.inspect
150171
=> "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
151172
#<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
152173
>> @posts.first.title = "hello from a debugger"
153174
=> "hello from a debugger"
175+
```
154176

155-
...and even better is that you can examine how your runtime objects actually work:
177+
and even better is that you can examine how your runtime objects actually work:
156178

179+
```
157180
>> f = @posts.first
158181
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
159182
>> f.
160183
Display all 152 possibilities? (y or n)
184+
```
161185

162186
Finally, when you're ready to resume execution, you enter "cont"
163187

164188

165-
== Console
189+
Console
190+
-------
166191

167192
You can interact with the domain model by starting the console through <tt>script/console</tt>.
168193
Here you'll have all parts of the application configured, just like it is when the
@@ -172,72 +197,70 @@ Passing an argument will specify a different environment, like <tt>script/consol
172197

173198
To reload your controllers and models after launching the console run <tt>reload!</tt>
174199

175-
== dbconsole
200+
**dbconsole**
176201

177202
You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
178203
You would be connected to the database with the credentials defined in database.yml.
179-
Starting the script without arguments will connect you to the development database. Passing an
180-
argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
204+
Starting the script without arguments will connect you to the development database. Passing an argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
205+
181206
Currently works for mysql, postgresql and sqlite.
182207

183-
== Description of Contents
208+
Description of Contents
209+
-----------------------
184210

185-
app
211+
**app**
186212
Holds all the code that's specific to this particular application.
187213

188-
app/controllers
214+
**app/controllers**
189215
Holds controllers that should be named like weblogs_controller.rb for
190216
automated URL mapping. All controllers should descend from ApplicationController
191217
which itself descends from ActionController::Base.
192218

193-
app/models
219+
**app/models**
194220
Holds models that should be named like post.rb.
195221
Most models will descend from ActiveRecord::Base.
196222

197-
app/views
223+
**app/views**
198224
Holds the template files for the view that should be named like
199225
weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
200226
syntax.
201227

202-
app/views/layouts
228+
**app/views/layouts**
203229
Holds the template files for layouts to be used with views. This models the common
204230
header/footer method of wrapping views. In your views, define a layout using the
205-
<tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
231+
<tt>layout :default</tt> and create a file named default.html.erb. Inside default.html
232+
233+
**.erb,**
206234
call <% yield %> to render the view using this layout.
207235

208-
app/helpers
236+
**app/helpers**
209237
Holds view helpers that should be named like weblogs_helper.rb. These are generated
210238
for you automatically when using script/generate for controllers. Helpers can be used to
211239
wrap functionality for your views into methods.
212240

213-
config
241+
**config**
214242
Configuration files for the Rails environment, the routing map, the database, and other dependencies.
215243

216-
db
244+
**db**
217245
Contains the database schema in schema.rb. db/migrate contains all
218246
the sequence of Migrations for your schema.
219247

220-
doc
248+
**doc**
221249
This directory is where your application documentation will be stored when generated
222250
using <tt>rake doc:app</tt>
223251

224-
lib
252+
**lib**
225253
Application specific libraries. Basically, any kind of custom code that doesn't
226254
belong under controllers, models, or helpers. This directory is in the load path.
227255

228-
public
229-
The directory available for the web server. Contains subdirectories for images, stylesheets,
230-
and javascripts. Also contains the dispatchers and the default HTML files. This should be
231-
set as the DOCUMENT_ROOT of your web server.
256+
**public**
257+
The directory available for the web server. Contains subdirectories for images, stylesheets, and javascripts. Also contains the dispatchers and the default HTML files. This should be set as the DOCUMENT_ROOT of your web server.
232258

233-
script
259+
**script**
234260
Helper scripts for automation and generation.
235261

236-
test
237-
Unit and functional tests along with fixtures. When using the script/generate scripts, template
238-
test files will be generated for you and placed in this directory.
262+
**test**
263+
Unit and functional tests along with fixtures. When using the script/generate scripts, template test files will be generated for you and placed in this directory.
239264

240-
vendor
241-
External libraries that the application depends on. Also includes the plugins subdirectory.
242-
If the app has frozen rails, those gems also go here, under vendor/rails/.
243-
This directory is in the load path.
265+
**vendor**
266+
External libraries that the application depends on. Also includes the plugins subdirectory. If the app has frozen rails, those gems also go here, under vendor/rails/. This directory is in the load path.

0 commit comments

Comments
 (0)