Matthew J Martin

Joined

750 Experience
0 Lessons Completed
1 Question Solved

Activity

Posted in rendering issue

in my home page
def home
 @status_update = StatusUpdate.new
end

Posted in rendering issue

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.


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.