Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

ActionCable Part 3: can't write unknown attribute `user_id`, what am I missing?

General • Asked by Rob Sturcke

Having some trouble figuring out what I'm missing with submitting a message in the chatroom, I get the error for my messages_controller.rb saying that can't write unknown attribute `user_id. However checking the source files I saw that my messages_controller.rb was the exact same as the example under my create saying message.user = current_user is incorrect:

Error encountered at about 13min into tutorial.

  def create
    message =
    message.user = current_user
    redirect_to @chatroom

GoRails Screencast code from part 3:

My Code:

Running ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16], Rails

Thanks for your help,


Never mind! Missed adding user:reference when scrubbing back in the video!

I read this earlier and wasn't quite sure what it was, but that would explain it! :) Happy to help if you have any other questions.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.