1

我是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页面。

你知道这个问题吗?

问候

4

1 回答 1

3

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

我必须设置这样的路径:

main_app.start_path

瞧!

于 2014-10-14T14:00:55.483 回答