Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1327660b
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,发现更多精彩内容 >>
提交
1327660b
编写于
6月 23, 2012
作者:
C
Carlos Antonio da Silva
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6836 from flyerhzm/ruby_19_hash
Ruby 1.9 hash syntax for generated code
上级
95b0f630
a6a48130
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
16 deletion
+16
-16
railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt
...pp/templates/app/controllers/application_controller.rb.tt
+2
-2
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt
...s/app/templates/app/views/layouts/application.html.erb.tt
+1
-1
railties/lib/rails/generators/rails/app/templates/config/application.rb
...ails/generators/rails/app/templates/config/application.rb
+1
-1
railties/lib/rails/generators/rails/app/templates/config/routes.rb
...lib/rails/generators/rails/app/templates/config/routes.rb
+6
-6
railties/lib/rails/generators/rails/app/templates/test/performance/browsing_test.rb
...ors/rails/app/templates/test/performance/browsing_test.rb
+2
-2
railties/test/application/configuration_test.rb
railties/test/application/configuration_test.rb
+4
-4
未找到文件。
railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt
浏览文件 @
1327660b
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :reset_session instead.
protect_from_forgery :with => :exception
end
\ No newline at end of file
protect_from_forgery with: :exception
end
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt
浏览文件 @
1327660b
...
...
@@ -2,7 +2,7 @@
<html>
<head>
<title><
%=
camelized
%
></title>
<
%%=
stylesheet_link_tag
"
application
",
:media =
>
"all"
%
>
<
%%=
stylesheet_link_tag
"
application
",
media:
"
all
"
%
>
<
%%=
javascript_include_tag
"
application
"
%
>
<
%%=
csrf_meta_tags
%
>
</head>
...
...
railties/lib/rails/generators/rails/app/templates/config/application.rb
浏览文件 @
1327660b
...
...
@@ -13,7 +13,7 @@
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line.
Bundler.require(*Rails.groups(
:assets =
>
%w(development test)
))
Bundler.require(*Rails.groups(
assets:
%w(development test)))
# If you want your assets lazily compiled in production, use this line.
# Bundler.require(:default, :assets, Rails.env)
end
...
...
railties/lib/rails/generators/rails/app/templates/config/routes.rb
浏览文件 @
1327660b
<
%= app_const %>.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root
:to =
>
'welcome#index'
# root
to:
'welcome#index'
# Sample of regular route:
# get 'products/:id' =
>
'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# get 'products/:id/purchase' => 'catalog#purchase',
:as =>
:purchase
# This route can be invoked with purchase_url(
:id =>
product.id)
# get 'products/:id/purchase' => 'catalog#purchase',
as:
:purchase
# This route can be invoked with purchase_url(
id:
product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
...
...
@@ -39,7 +39,7 @@
# resources :products do
# resources :comments
# resources :sales do
# get 'recent',
:on =>
:collection
# get 'recent',
on:
:collection
# end
# end
...
...
@@ -52,4 +52,4 @@
# See how all your routes lay out with "rake routes"
end
\ No newline at end of file
end
railties/lib/rails/generators/rails/app/templates/test/performance/browsing_test.rb
浏览文件 @
1327660b
...
...
@@ -3,8 +3,8 @@
class
BrowsingTest
<
ActionDispatch
::
PerformanceTest
# Refer to the documentation for all available options
# self.profile_options = {
:runs => 5, :metrics =>
[:wall_time, :memory],
#
:output => 'tmp/performance', :formats =>
[:flat] }
# self.profile_options = {
runs: 5, metrics:
[:wall_time, :memory],
#
output: 'tmp/performance', formats:
[:flat] }
def
test_homepage
get
'/'
...
...
railties/test/application/configuration_test.rb
浏览文件 @
1327660b
...
...
@@ -69,11 +69,11 @@ def teardown
Rails
.
env
=
"development"
assert_equal
[
:default
,
"development"
],
Rails
.
groups
assert_equal
[
:default
,
"development"
,
:assets
],
Rails
.
groups
(
:assets
=>
[
:development
])
assert_equal
[
:default
,
"development"
,
:another
,
:assets
],
Rails
.
groups
(
:another
,
:assets
=>
%w(development)
)
assert_equal
[
:default
,
"development"
,
:assets
],
Rails
.
groups
(
assets:
[
:development
])
assert_equal
[
:default
,
"development"
,
:another
,
:assets
],
Rails
.
groups
(
:another
,
assets:
%w(development)
)
Rails
.
env
=
"test"
assert_equal
[
:default
,
"test"
],
Rails
.
groups
(
:assets
=>
[
:development
])
assert_equal
[
:default
,
"test"
],
Rails
.
groups
(
assets:
[
:development
])
ENV
[
"RAILS_GROUPS"
]
=
"javascripts,stylesheets"
assert_equal
[
:default
,
"test"
,
"javascripts"
,
"stylesheets"
],
Rails
.
groups
...
...
@@ -567,7 +567,7 @@ def self.attribute_names
app_file
'app/controllers/application_controller.rb'
,
<<-
RUBY
class ApplicationController < ActionController::Base
protect_from_forgery
:with =>
:reset_session # as we are testing API here
protect_from_forgery
with:
:reset_session # as we are testing API here
end
RUBY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录