test_controller.rb

来自「RubyonRailsC.zip ruby on rails的源码」· RB 代码 · 共 21 行

RB
21
字号
class TestController < ApplicationController
	
	def one
		cookies[:name] = "Squirrel"
		render(:text => cookies[:name].to_s)
	end
	
	def two
		cookies[:current_time] = Time.now.to_s
		redirect_to(:action => "three")
	end
	
	def three
		render(:text => cookies[:current_time].to_s)
	end
	
	def four
		cookies[:test_cookies] = {:value => "four",
						     :expires => 10.days.from_now}
	end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?