All threads / rendering issue

Ask A Question

Notifications

You’re not receiving notifications from this thread.

rendering issue

Matthew J Martin asked in Rails
OK, so I fairly new at rails, but i'm at the point where i feel confidence enough to start making my own side project which i decide would be a clone of facebook in rails. first i'm working on is getting status updates working. I got it setup as the StatusUpdate is a model that tobe called by the Pages controller to render on the index page, now the issue I'm having is I use form_for(@status_update) command I get 
undefined method `to_key' for #<StatusUpdate::ActiveRecord_Relation:0x00000000049d3448>
Did you mean?  to_set
               to_ary
if i use form_with(model: @status_update) 
undefined method `to_model' for #<StatusUpdate::ActiveRecord_Relation:0x000000000471cd80>
Did you mean?  to_xml
If i use form_with(model: status_update)

undefined local variable or method `status_update' for #<#<Class:0x0000000005801678>:0x0000000002ec8ec8>
Did you mean?  @status_update

I'm just getting a little fustrated with this.


What did you set `@status_update` to in your controller's action?
in my home page
def home
 @status_update = StatusUpdate.new
end
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,885+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.