railties 3.0.4 → 3.0.5.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/guides/source/api_documentation_guidelines.textile +1 -1
- data/guides/source/contributing_to_ruby_on_rails.textile +1 -1
- data/guides/source/getting_started.textile +1 -1
- data/guides/source/routing.textile +4 -6
- data/lib/rails/generators/named_base.rb +2 -2
- data/lib/rails/generators/rails/app/templates/Gemfile +1 -1
- data/lib/rails/version.rb +2 -2
- metadata +25 -17
@@ -27,7 +27,7 @@ Communicate to the reader the current way of doing things, both explicitly and i
|
|
27
27
|
|
28
28
|
Documentation has to be concise but comprehensive. Explore and document edge cases. What happens if a module is anonymous? What if a collection is empty? What if an argument is nil?
|
29
29
|
|
30
|
-
The proper names of Rails components have a space in between the words, like "Active Support". +ActiveRecord+ is a Ruby module, whereas Active Record is an ORM.
|
30
|
+
The proper names of Rails components have a space in between the words, like "Active Support". +ActiveRecord+ is a Ruby module, whereas Active Record is an ORM. All Rails documentation should consistently refer to Rails components by their proper name, and if in your next blog post or presentation you remember this tidbit and take it into account that'd be fenomenal :).
|
31
31
|
|
32
32
|
Spell names correctly: HTML, MySQL, JavaScript, ERb. Use the article "an" for "SQL", as in "an SQL statement". Also "an SQLite database".
|
33
33
|
|
@@ -175,7 +175,7 @@ In any case, Rails will create a folder in your working directory called <tt>blo
|
|
175
175
|
|
176
176
|
|_.File/Folder|_.Purpose|
|
177
177
|
|Gemfile|This file allows you to specify what gem dependencies are needed for your Rails application.|
|
178
|
-
|README
|
178
|
+
|README|This is a brief instruction manual for your application. Use it to tell others what your application does, how to set it up, and so on.|
|
179
179
|
|Rakefile|This file contains batch jobs that can be run from the terminal.|
|
180
180
|
|app/|Contains the controllers, models, and views for your application. You'll focus on this folder for the remainder of this guide.|
|
181
181
|
|config/|Configure your application's runtime rules, routes, database, and more.|
|
@@ -388,6 +388,8 @@ NOTE: You can't use +namespace+ or +:module+ with a +:controller+ path segment.
|
|
388
388
|
match ':controller(/:action(/:id))', :controller => /admin\/[^\/]+/
|
389
389
|
</ruby>
|
390
390
|
|
391
|
+
TIP: By default dynamic segments don't accept dots - this is because the dot is used as a separator for formatted routes. If you need to use a dot within a dynamic segment add a constraint which overrides this - for example +:id => /[^\/]+/+ allows anything except a slash.
|
392
|
+
|
391
393
|
h4. Static Segments
|
392
394
|
|
393
395
|
You can specify static segments when creating a route:
|
@@ -643,6 +645,8 @@ end
|
|
643
645
|
|
644
646
|
NOTE: Of course, you can use the more advanced constraints available in non-resourceful routes in this context.
|
645
647
|
|
648
|
+
TIP: By default the +:id+ parameter doesn't accept dots - this is because the dot is used as a separator for formatted routes. If you need to use a dot within an +:id+ add a constraint which overrides this - for example +:id => /[^\/]+/+ allows anything except a slash.
|
649
|
+
|
646
650
|
h4. Overriding the Named Helpers
|
647
651
|
|
648
652
|
The +:as+ option lets you override the normal naming for the named route helpers. For example:
|
@@ -837,12 +841,6 @@ You can supply a +:method+ argument to specify the HTTP verb:
|
|
837
841
|
assert_recognizes({ :controller => "photos", :action => "create" }, { :path => "photos", :method => :post })
|
838
842
|
</ruby>
|
839
843
|
|
840
|
-
You can also use the resourceful helpers to test recognition of a RESTful route:
|
841
|
-
|
842
|
-
<ruby>
|
843
|
-
assert_recognizes new_photo_url, { :path => "photos", :method => :post }
|
844
|
-
</ruby>
|
845
|
-
|
846
844
|
h5. The +assert_routing+ Assertion
|
847
845
|
|
848
846
|
The +assert_routing+ assertion checks the route both ways: it tests that the path generates the options, and that the options generate the path. Thus, it combines the functions of +assert_generates+ and +assert_recognizes+.
|
@@ -55,11 +55,11 @@ module Rails
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def singular_table_name
|
58
|
-
@singular_table_name ||= table_name.singularize
|
58
|
+
@singular_table_name ||= (pluralize_table_names? ? table_name.singularize : table_name)
|
59
59
|
end
|
60
60
|
|
61
61
|
def plural_table_name
|
62
|
-
@plural_table_name ||= table_name.pluralize
|
62
|
+
@plural_table_name ||= (pluralize_table_names? ? table_name : table_name.pluralize)
|
63
63
|
end
|
64
64
|
|
65
65
|
def plural_file_name
|
data/lib/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424095
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 5
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.0.5.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Heinemeier Hansson
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2011-02-
|
20
|
+
date: 2011-02-22 00:00:00 -08:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
@@ -58,12 +60,14 @@ dependencies:
|
|
58
60
|
requirements:
|
59
61
|
- - "="
|
60
62
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
63
|
+
hash: 15424095
|
62
64
|
segments:
|
63
65
|
- 3
|
64
66
|
- 0
|
65
|
-
-
|
66
|
-
|
67
|
+
- 5
|
68
|
+
- rc
|
69
|
+
- 1
|
70
|
+
version: 3.0.5.rc1
|
67
71
|
type: :runtime
|
68
72
|
version_requirements: *id003
|
69
73
|
- !ruby/object:Gem::Dependency
|
@@ -74,12 +78,14 @@ dependencies:
|
|
74
78
|
requirements:
|
75
79
|
- - "="
|
76
80
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
81
|
+
hash: 15424095
|
78
82
|
segments:
|
79
83
|
- 3
|
80
84
|
- 0
|
81
|
-
-
|
82
|
-
|
85
|
+
- 5
|
86
|
+
- rc
|
87
|
+
- 1
|
88
|
+
version: 3.0.5.rc1
|
83
89
|
type: :runtime
|
84
90
|
version_requirements: *id004
|
85
91
|
description: "Rails internals: application bootup, plugins, generators, and rake tasks."
|
@@ -457,7 +463,7 @@ files:
|
|
457
463
|
- lib/rails/generators/rails/app/templates/test/integration/.empty_directory
|
458
464
|
- lib/rails/generators/rails/app/templates/test/unit/.empty_directory
|
459
465
|
- lib/rails/generators/rails/generator/templates/templates/.empty_directory
|
460
|
-
has_rdoc:
|
466
|
+
has_rdoc: true
|
461
467
|
homepage: http://www.rubyonrails.org
|
462
468
|
licenses: []
|
463
469
|
|
@@ -481,16 +487,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
481
487
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
482
488
|
none: false
|
483
489
|
requirements:
|
484
|
-
- - "
|
490
|
+
- - ">"
|
485
491
|
- !ruby/object:Gem::Version
|
486
|
-
hash:
|
492
|
+
hash: 25
|
487
493
|
segments:
|
488
|
-
-
|
489
|
-
|
494
|
+
- 1
|
495
|
+
- 3
|
496
|
+
- 1
|
497
|
+
version: 1.3.1
|
490
498
|
requirements: []
|
491
499
|
|
492
500
|
rubyforge_project: rails
|
493
|
-
rubygems_version: 1.
|
501
|
+
rubygems_version: 1.5.2
|
494
502
|
signing_key:
|
495
503
|
specification_version: 3
|
496
504
|
summary: Tools for creating, working with, and running Rails applications.
|