我正在将Rails 2.2.2应用程序迁移到Rails 3,显然我必须将位于application_helper.rb中的方法移动到其他地方。
当我加载Rails 3版本的页面时,它使用Rails 2.2.2 application_helper.rb中的方法,我得到了
undefined method 'my_method_in_application_helper_rb'
有人可以解释一下application_helper.rb中的方法应该去哪里,以便在Rails 3中看到它们吗?
谢谢!
答案 0 :(得分:0)
我使用了一个Rails迁移脚本,它将Rails 2.2.2 application_helper.rb方法放在同名文件中,文件扩展名为.rails2。我只是将方法从那里复制到Rails 3 application_helper.rb文件中 - 现在全部工作