提交 1327660b 编写于 作者: C Carlos Antonio da Silva

Merge pull request #6836 from flyerhzm/ruby_19_hash

Ruby 1.9 hash syntax for generated code
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
......@@ -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>
......
......@@ -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
......
<%= 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
......@@ -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 '/'
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册