Given:
Two controllers under /app/controllers
named:
- customers_controller.rb (CustomersController)
- home_controller.rb (HomeController)
Problem:
When I run rails command (i.e. rails c
) this is what I get:
ruby-1.9.2-p290 :001 > CustomersController
=> CustomersController
ruby-1.9.2-p290 :002 > HomeController
NameError: uninitialized constant HomeController
from /home/aaron/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
from (irb):2
from /home/aaron/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in `start'
from /home/aaron/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in `start'
from /home/aaron/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
So whats the deal? Why isn't HomeController
being recognized by my application?
Edit:
My home_controller.rb file:
class HomeController < ApplicationController
def index
end
def sign_up
end
def faq
end
def terms
end
def privacy
end
def feedback
end
end
Theres not much in it.