ruby - Rails 4: Own engine "No route matches" -
i write..
rails new testapp cd testapp/ rails plugin new blog --mountable cd blog/ rails g scaffold post name description:text rake db:migrate cd ../ rails s
go localhost:3000/blog/posts/index , error "no route matches [get] "/blog/posts/index""
what i'm doing wrong?
putting engine @ random directory inside application won't make magically work. don't know learned technique from, wrong.
you should put engine outside application , require application's gemfile, this:
gem 'blog', :path => '../blog'
then engine automatically loaded rails.
the engines guide goes more detail. highly recommend reading that.
Comments
Post a Comment