制作plugins出现问题

0 views
Skip to first unread message

大师傅

unread,
Sep 2, 2007, 11:03:14 AM9/2/07
to rails4scm
诸位谁做过rails的plugin插件啊, 本工程中的vendor\plugins\fs_treeview 展现部分已经写完了。通过扩
展ActionView::Base 能够将 <%= treeview_tag%> 正确输出。 但扩展
ActionController::Base出现了问题!

在扩展ActionView时,只要在模块中增加方法(类似一般的helper类)就可以搞定。 但在ActionController中增加方
法,并不可以生成新的action! 提示No action responded to forallsoft_treeview_action 估
计和route机制有关。 此forallsoft_treeview_action 扩展到了ActionController::Base类中,但
由于具体的Action类是从中继承的,可能route机制就扫描不到这个方法了,所以报错?

各位高手是否知道如何正确扩展ActionController类呢? 还有如何得到当前的URL,以便在回调动作完成后,仍然返回到当前的
URL? 看来TREEVEIW组件的回调没有想想的简单啊。

紧急求助了!

Reply all
Reply to author
Forward
0 new messages