質問

I was working my way through Hartl's Ruby on Rail's Tutorial chapter 4 when I ran into a problem. My project loaded just fine in the rails server until I added the full_title_helper.rb file.

I get:

RuntimeError (Circular dependency detected while autoloading constant FullTitleHelper):

app/controllers/application_controller.rb:1:in 'top (required)'

app/controllers/static_pages_controller.rb:1:in 'top (required)'

I tried adding config.middleware.delete Rack::Lock to my development.rb file as per this suggestion but that didn't help.

I tried switching from rails 4.0.2 to 4.0.0; that didn't work.

My full_title_helper.rb is directly from Hartl's page

module ApplicationHelper

# Returns the full title with minor modifications depending on the page
def full_title(page_title)
    base_title = "Ruby on Rails Tutorial Sample App"
    if page_title.empty?
        base_title
    else
        "#{base_title} | #{page_title}"
    end
end
end

What do I do to fix this?

役に立ちましたか?

解決

My mistake, I mis-named the helper file. Thanks to anyone who looked at this question.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top