Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving to new hash syntax #7890

Merged
merged 1 commit into from Oct 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions actionpack/lib/action_controller/base.rb
Expand Up @@ -43,7 +43,7 @@ module ActionController
#
# def server_ip
# location = request.env["SERVER_ADDR"]
# render :text => "This server hosted at #{location}"
# render text: "This server hosted at #{location}"
# end
#
# == Parameters
Expand Down Expand Up @@ -113,9 +113,9 @@ module ActionController
# def search
# @results = Search.find(params[:query])
# case @results.count
# when 0 then render :action => "no_results"
# when 1 then render :action => "show"
# when 2..10 then render :action => "show_many"
# when 0 then render action: "no_results"
# when 1 then render action: "show"
# when 2..10 then render action: "show_many"
# end
# end
#
Expand All @@ -131,7 +131,7 @@ module ActionController
# @entry = Entry.new(params[:entry])
# if @entry.save
# # The entry was saved correctly, redirect to show
# redirect_to :action => 'show', :id => @entry.id
# redirect_to action: 'show', id: @entry.id
# else
# # things didn't go so well, do something else
# end
Expand All @@ -148,15 +148,15 @@ module ActionController
# An action may contain only a single render or a single redirect. Attempting to try to do either again will result in a DoubleRenderError:
#
# def do_something
# redirect_to :action => "elsewhere"
# render :action => "overthere" # raises DoubleRenderError
# redirect_to action: "elsewhere"
# render action: "overthere" # raises DoubleRenderError
# end
#
# If you need to redirect on the condition of something, then be sure to add "and return" to halt execution.
#
# def do_something
# redirect_to(:action => "elsewhere") and return if monkeys.nil?
# render :action => "overthere" # won't be called if monkeys is nil
# redirect_to(action: "elsewhere") and return if monkeys.nil?
# render action: "overthere" # won't be called if monkeys is nil
# end
#
class Base < Metal
Expand Down