?? 04 - displaying templates with render.rb
字號:
class ListController < ApplicationController def index @list = ['papaya', 'polio vaccine'] render :action => 'shopping_list' end def shopping_list @list = ['cotton balls', 'amino acids', 'pie'] endend#---class ListController < ApplicationController def index render :action => 'shopping_list' @budget = 87.50 end def shopping_list @list = ['lizard food', 'baking soda'] endend#---class ListController < ApplicationController def index shopping_list and render :action => 'shopping_list' @budget = 87.50 endend#---class ListController < ApplicationController def plain_and_fancy render :action => 'plain_list' render :action => 'fancy_list' end#---class ListController < ApplicationController def plain_or_fancy if params[:fancy] render :action => 'fancy_list' else render :action => 'plain_list' end endend#---class ListController < ApplicationController def index render :action => 'shopping_list' and return @budget = 87.50 # This line won't be run. endend#---
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -