阅读背景:

在Rails中,如何从视图中输出动作的名称?

来源:互联网 

If I render the update action from inside the create action, is there a way for the "update" view (i.e. update.html.erb) to know which action rendered it. I want the update view to print out the action name "create" when the create action renders it and print out the word "update" when the update action renders it. The problem is render seems to defer control to the invoked action so for all intents and purposes the update view always thinks it's coming from the update action.If I render the update action from inside the c




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: