uninitialized constant

Lilz picture Lilz · Nov 22, 2009 · Viewed 28.8k times · Source

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

Answer

erik picture erik · Nov 22, 2009

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.