mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
minor fixesin READMEs
This commit is contained in:
parent
4197fad841
commit
4038a6bc0f
4 changed files with 6 additions and 6 deletions
|
@ -59,7 +59,7 @@ generated would look like this:
|
||||||
|
|
||||||
Mr. david@loudthinking.com
|
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
|
<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.
|
simply call the method and optionally call +deliver+ on the return value.
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ methods:
|
||||||
layout "weblog/layout"
|
layout "weblog/layout"
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@posts = Post.find(:all)
|
@posts = Post.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -84,7 +84,7 @@ modules:
|
||||||
attr_reader :errors
|
attr_reader :errors
|
||||||
|
|
||||||
def validate!
|
def validate!
|
||||||
errors.add(:name, "can not be nil") if name == nil
|
errors.add(:name, "can not be nil") if name.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def ErrorsPerson.human_attribute_name(attr, options = {})
|
def ErrorsPerson.human_attribute_name(attr, options = {})
|
||||||
|
@ -94,10 +94,10 @@ modules:
|
||||||
end
|
end
|
||||||
|
|
||||||
person.errors.full_messages
|
person.errors.full_messages
|
||||||
# => ["Name Can not be nil"]
|
# => ["Name can not be nil"]
|
||||||
|
|
||||||
person.errors.full_messages
|
person.errors.full_messages
|
||||||
# => ["Name Can not be nil"]
|
# => ["Name can not be nil"]
|
||||||
|
|
||||||
{Learn more}[link:classes/ActiveModel/Errors.html]
|
{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
|
# for GET http://api.people.com:3000/people.xml
|
||||||
#
|
#
|
||||||
people = Person.find(:all)
|
people = Person.all
|
||||||
people.first # => <Person::xxx 'first' => 'Ryan' ...>
|
people.first # => <Person::xxx 'first' => 'Ryan' ...>
|
||||||
people.last # => <Person::xxx 'first' => 'Jim' ...>
|
people.last # => <Person::xxx 'first' => 'Jim' ...>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue