1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Minor doc fix of ActiveModel::Naming.

- qoute example line's result when it kind of String
- right ("singular_route_key") method in example
This commit is contained in:
Andrey Samsonov 2013-10-29 15:23:03 +04:00
parent 5225a938d6
commit fb6f02c521

View file

@ -263,10 +263,10 @@ module ActiveModel
# namespaced models regarding whether it's inside isolated engine.
#
# # For isolated engine:
# ActiveModel::Naming.route_key(Blog::Post) #=> post
# ActiveModel::Naming.singular_route_key(Blog::Post) #=> "post"
#
# # For shared engine:
# ActiveModel::Naming.route_key(Blog::Post) #=> blog_post
# ActiveModel::Naming.singular_route_key(Blog::Post) #=> "blog_post"
def self.singular_route_key(record_or_class)
model_name_from_record_or_class(record_or_class).singular_route_key
end
@ -275,10 +275,10 @@ module ActiveModel
# namespaced models regarding whether it's inside isolated engine.
#
# # For isolated engine:
# ActiveModel::Naming.route_key(Blog::Post) #=> posts
# ActiveModel::Naming.route_key(Blog::Post) #=> "posts"
#
# # For shared engine:
# ActiveModel::Naming.route_key(Blog::Post) #=> blog_posts
# ActiveModel::Naming.route_key(Blog::Post) #=> "blog_posts"
#
# The route key also considers if the noun is uncountable and, in
# such cases, automatically appends _index.
@ -290,10 +290,10 @@ module ActiveModel
# namespaced models regarding whether it's inside isolated engine.
#
# # For isolated engine:
# ActiveModel::Naming.param_key(Blog::Post) #=> post
# ActiveModel::Naming.param_key(Blog::Post) #=> "post"
#
# # For shared engine:
# ActiveModel::Naming.param_key(Blog::Post) #=> blog_post
# ActiveModel::Naming.param_key(Blog::Post) #=> "blog_post"
def self.param_key(record_or_class)
model_name_from_record_or_class(record_or_class).param_key
end