Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninitialized constant

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

like image 893
Lilz Avatar asked May 13 '26 07:05

Lilz


1 Answers

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.

like image 191
erik Avatar answered May 16 '26 02:05

erik