RailsApps/rails3-bootstrap-devise-cancan

New Model

victor-rocha opened this issue · 5 comments

Hey, I've been trying to use rails3-bootstrap-devise-cancan , and its great ! :D
But, when I try to add a new model just like this : rails g scaffold Post title:string body:text
And run 'rake db:migrate', it works well.

But dosen't work :/
I get this error : No route matches {:controller=>"devise/posts"}

And the question is: How to add a new model?
Thanks guys ! :D

What doesn't work? Try:
http://localhost:3000/posts
and you'll see it works.

Not sure why you are using the URL
http://localhost:3000/devise/posts

Actually, im trying http://localhost:3000/posts. But it shows up that error: No route matches {:controller=>"devise/posts"}

Check your config/routes.rb file. Make sure

resources :posts

is the first line in the file (NOT after anything else).

Let's see what your config/routes.rb file is. Please post it here.

Thanks Daniel, It works now! I didn't know that I should put it in the first line!

Thank You! :D

Order counts in the routes.rb file and is often a cause of problems. Glad you've got it sorted out.