I get this error in the browser when I attempt to view localhost:3000/galleries
Routing Error
undefined method `sub' for nil:NilClass
My log file tells me
ActionController::RoutingError (undefined method ‘sub’ for nil:NilClass)`
app/controllers/galleries_controller.rb:1:in `<top (required)>'
Rendered /Users/mikev/.rvm/gems/ruby-1.9.3-head/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)
routes.rb
Gallery::Application.routes.draw do
match 'galleries' => 'galleries#index'
end
controllers/galleries_controller.rb:
class GalleriesController < ApplicationController
def index
end
end
views/galleries/index.html.erb is empty
Any idea what this means?
This problem usually occurs when the router tries to look up a constant name and fails.
Do you have a helper in app/helpers/galleries_helper.rb? If so, does it define GalleriesHelper?