I’m trying to write my first rails 3 gem – everything works well, except for routes – I can’t seem to get them working. It’s possible this is a very simple error – as mentioned, it’s my first experience with engines. The gem itself is very, very basic – literally just one scaffold
My gem’s config/routes file:
class ActionController::Routing::RouteSet
resources :frogs
end
…And when I try to start the server, I get the following error:
/home/john/.rvm/gems/ruby-1.9.2-p0/gems/cancandevise-0.1.0/config/routes.rb:3:in
<class:RouteSet>': undefined methodresources’ for
ActionDispatch::Routing::RouteSet:Class
(NoMethodError)
Any suggestions much appreciated. At the present moment, the gem is nothing more than a very basic rails-generated ‘frog’ scaffold
Cheers,
– JB
@marcgg, I believe that’s the syntax for a regular rails app, but I think he’s talking about an engine.
@unclaimedbaggage, your engine/gem routes file should look like this:
I made an example engine that touches on all the common setup issues I encountered when creating my first gem, you might find it helpful to reference:
http://keithschacht.com/creating-a-rails-3-engine-plugin-gem/