2

I'm trying to do this tutorial-> http://netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html

BUT

its giving me this error:

NameError in PostsController#index

uninitialized constant PostsController::Posts

I don't know whats wrong

Lilz
  • 4,013
  • 13
  • 61
  • 95
  • when i right-click on the project and test it tells me that PostsControllerTest failed because "Unknown database 'project_test'" – Lilz Nov 22 '09 at 20:02
  • You can create the test database with `rake environment=test db:create` – EmFi Nov 22 '09 at 23:25
  • The link in the question is broken. It was better to post the issue in full. – mohghaderi May 09 '19 at 20:55

1 Answers1

12

Somewhere in the files processed for your action you have tried to use a class called Posts. Try using Post instead of Posts. There is no Posts class. You are probably looking for the Post model class.

Look for the mistake in either in the index method of posts_controller.rb or in app/views/posts/index.html.erb. The error message should help you find the offending line.

EmFi
  • 23,435
  • 3
  • 57
  • 68
erik
  • 6,406
  • 3
  • 36
  • 36