mirror of https://github.com/rails/rails
minor fixesin READMEs
This commit is contained in:
parent
4197fad841
commit
4038a6bc0f
|
@ -59,7 +59,7 @@ generated would look like this:
|
|||
|
||||
Mr. david@loudthinking.com
|
||||
|
||||
In previous version of rails you would call <tt>create_method_name</tt> and
|
||||
In previous version of Rails you would call <tt>create_method_name</tt> and
|
||||
<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface, you
|
||||
simply call the method and optionally call +deliver+ on the return value.
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ methods:
|
|||
layout "weblog/layout"
|
||||
|
||||
def index
|
||||
@posts = Post.find(:all)
|
||||
@posts = Post.all
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -84,7 +84,7 @@ modules:
|
|||
attr_reader :errors
|
||||
|
||||
def validate!
|
||||
errors.add(:name, "can not be nil") if name == nil
|
||||
errors.add(:name, "can not be nil") if name.nil?
|
||||
end
|
||||
|
||||
def ErrorsPerson.human_attribute_name(attr, options = {})
|
||||
|
@ -94,10 +94,10 @@ modules:
|
|||
end
|
||||
|
||||
person.errors.full_messages
|
||||
# => ["Name Can not be nil"]
|
||||
# => ["Name can not be nil"]
|
||||
|
||||
person.errors.full_messages
|
||||
# => ["Name Can not be nil"]
|
||||
# => ["Name can not be nil"]
|
||||
|
||||
{Learn more}[link:classes/ActiveModel/Errors.html]
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ Collections can also be requested in a similar fashion
|
|||
#
|
||||
# for GET http://api.people.com:3000/people.xml
|
||||
#
|
||||
people = Person.find(:all)
|
||||
people = Person.all
|
||||
people.first # => <Person::xxx 'first' => 'Ryan' ...>
|
||||
people.last # => <Person::xxx 'first' => 'Jim' ...>
|
||||
|
||||
|
|
Loading…
Reference in New Issue