Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
bd0550ef
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd0550ef
编写于
8月 27, 2011
作者:
S
Santiago Pastorino
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2714 from vijaydev/docs
doc fixes
上级
827a0fee
8526f727
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
15 deletion
+19
-15
README.rdoc
README.rdoc
+3
-3
actionpack/lib/action_controller/metal/params_wrapper.rb
actionpack/lib/action_controller/metal/params_wrapper.rb
+8
-8
actionpack/lib/action_dispatch/routing/url_for.rb
actionpack/lib/action_dispatch/routing/url_for.rb
+8
-4
未找到文件。
README.rdoc
浏览文件 @
bd0550ef
...
...
@@ -8,12 +8,12 @@ into three layers, each with a specific responsibility.
The View layer is composed of "templates" that are responsible for providing
appropriate representations of your application's resources. Templates
can come in a variety of formats, but most view templates are
HTML with embedded Ruby
can come in a variety of formats, but most view templates are
\HTML with embedded Ruby
code (.erb files).
The Model layer represents your domain model (such as Account, Product, Person, Post)
and encapsulates the business logic that is specific to your application. In Rails,
database-backed model classes are derived from ActiveRecord::Base. ActiveRecord allows
database-backed model classes are derived from ActiveRecord::Base. Active
Record allows
you to present the data from database rows as objects and embellish these data objects
with business logic methods. Although most Rails models are backed by a database, models
can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as
...
...
@@ -21,7 +21,7 @@ provided by the ActiveModel module. You can read more about Active Record in its
{README}[link:/rails/rails/blob/master/activerecord/README.rdoc].
The Controller layer is responsible for handling incoming HTTP requests and providing a
suitable response. Usually this means returning HTML, but Rails controllers can also
suitable response. Usually this means returning
\
HTML, but Rails controllers can also
generate XML, JSON, PDFs, mobile-specific views, and more. Controllers manipulate models
and render view templates in order to generate the appropriate HTTP response.
...
...
actionpack/lib/action_controller/metal/params_wrapper.rb
浏览文件 @
bd0550ef
...
...
@@ -6,30 +6,30 @@
require
'action_dispatch/http/mime_types'
module
ActionController
# Wraps
parameters hash into nested hash. This will allow client
to submit
# POST request
without having to specify a root element in it
.
# Wraps
the parameters hash into a nested hash. This will allow clients
to submit
# POST request
s without having to specify any root elements
.
#
# This functionality is enabled in +config/initializers/wrap_parameters.rb+
# and can be customized. If you are upgrading to Rails 3.1, this file will
# and can be customized. If you are upgrading to
\
Rails 3.1, this file will
# need to be created for the functionality to be enabled.
#
# You could also turn it on per controller by setting the format array to
# non-empty array:
#
a
non-empty array:
#
# class UsersController < ApplicationController
# wrap_parameters :format => [:json, :xml]
# end
#
# If you enable +ParamsWrapper+ for +:json+ format
. I
nstead of having to
# If you enable +ParamsWrapper+ for +:json+ format
, i
nstead of having to
# send JSON parameters like this:
#
# {"user": {"name": "Konata"}}
#
# You can
now just send a
parameters like this:
# You can
send
parameters like this:
#
# {"name": "Konata"}
#
# And it will be wrapped into a nested hash with the key name matching
# And it will be wrapped into a nested hash with the key name matching
the
# controller's name. For example, if you're posting to +UsersController+,
# your new +params+ hash will look like this:
#
...
...
@@ -81,7 +81,7 @@ module ClassMethods
#
# ==== Examples
# wrap_parameters :format => :xml
# # enables the parmeter wrapper for XML format
# # enables the par
a
meter wrapper for XML format
#
# wrap_parameters :person
# # wraps parameters into +params[:person]+ hash
...
...
actionpack/lib/action_dispatch/routing/url_for.rb
浏览文件 @
bd0550ef
...
...
@@ -131,10 +131,14 @@ def url_options
#
# Examples:
#
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :port => '8080' # => 'http://somehost.org:8080/tasks/testing'
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :anchor => 'ok', :only_path => true # => '/tasks/testing#ok'
# url_for :controller => 'tasks', :action => 'testing', :trailing_slash => true # => 'http://somehost.org/tasks/testing/'
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :number => '33' # => 'http://somehost.org/tasks/testing?number=33'
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :port => '8080'
# # => 'http://somehost.org:8080/tasks/testing'
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :anchor => 'ok', :only_path => true
# # => '/tasks/testing#ok'
# url_for :controller => 'tasks', :action => 'testing', :trailing_slash => true
# # => 'http://somehost.org/tasks/testing/'
# url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :number => '33'
# # => 'http://somehost.org/tasks/testing?number=33'
def
url_for
(
options
=
nil
)
case
options
when
String
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录