routing - Rails newbie: How to add routes to a rails 3 engine? -


i'm trying write first rails 3 gem - works well, except routes - can't seem them working. it's possible simple error - mentioned, it's first experience engines. gem very, basic - literally 1 scaffold

my gem's config/routes file:

class actioncontroller::routing::routeset   resources :frogs end 

...and when try start server, following error:

/home/john/.rvm/gems/ruby-1.9.2-p0/gems/cancandevise-0.1.0/config/routes.rb:3:in <class:routeset>': undefined method resources' actiondispatch::routing::routeset:class (nomethoderror)

any suggestions appreciated. @ present moment, gem nothing more basic rails-generated 'frog' scaffold

cheers, - jb

@marcgg, believe that's syntax regular rails app, think he's talking engine.

@unclaimedbaggage, engine/gem routes file should this:

rails.application.routes.draw |map|   resources :frogs end 

i made example engine touches on common setup issues encountered when creating first gem, might find helpful reference:

http://keithschacht.com/creating-a-rails-3-engine-plugin-gem/


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -