测试回调事件

0 views
Skip to first unread message

大师傅

unread,
Aug 26, 2007, 2:30:57 AM8/26/07
to rails4scm
通过以下代码基本搞定, 但使用了flash---根据宝书"19.6 Flash-Communicating between Actions"
不知是否由其他方法:

class LinkController < ApplicationController
def index
@value=flash[:what]
end

def show_param
id=params[:id]
if id.=="1" then
@value= "link 1"
else
@value="another link"
end
flash[:what]=@value
redirect_to :action => "index"
end
end

Reply all
Reply to author
Forward
0 new messages