Stuck on 3/7


Having issues getting through this point. Have tried everything imaginable, seems so simple but I'm completely stuck. Somebody help please!

  1. Then in the Messages controller (app/controllers/messages_controller.rb), add an index action:

def index
@messages = Message.all



Your code looks fine to me. Could you post the error message you're getting and a link to the exercise you're on?


here is the link

Error message includes: Oops! The test returned an error. Maybe you have a syntax error, or a typo. Hide error.
/var/lib/gems/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:389:in `check_pending!': (ActiveRecord::PendingMigrationError)



It looks to me like you need to run a database migration.

$ rake db:migrate


Tried and then entered code. Did not work, am I missing something here? Very confused



getting this error now:
app/controllers/messages_controller.rb:1: class/module name must be CONSTANT (SyntaxError)

#7 Could you copy/paste everything in that file (app/controllers/messages_controller.rb) into here so I can see the code causing that error please?


@zystvan here it is. thanks for your help

#9 Remove the word index from line 1.


@zystvan I tried and here is what I have now

#11 Press the Enter key after def index, @messages = Message.all, and the first end.


@zystvan Thank you!!! It worked!


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.