Forem - 布局无法识别路线

时间:2014-09-18 09:18:33

标签: ruby-on-rails forem

我是forem宝石的新手。我想为我的应用程序和论坛设置相同的布局。

我更改了默认config/initializers/forem.rb以设置我的app/views/layouts/application.html.erb布局:

Rails.application.config.to_prepare do
  Forem::ApplicationController.layout "application"
end

我收到此错误:

ActionView::Template::Error (undefined local variable or method `start_path' for #<#<Class:0x00000008fb00d8>:0x00000008f5ec10>):

...我的配置的一些更多信息:

  • 此布局包含以下行:

    <%= link_to("Start", start_path) %>

  • 我的config/routes包含以下行:

    get 'start' => 'statics#start', :as => :start

  • rake routes | grep start会返回此信息:

    start GET /start(.:format) statics#start

  • 布局完全适用于forem页。

你对这个问题有什么看法吗?

此致

1 个答案:

答案 0 :(得分:3)

我为下一位读者自动回答。

我必须设置这样的路径:

main_app.start_path

瞧!

相关问题