text: what did i missed?
  ERROR: undefined local variable or method `feedback' for #<#:0x007f66dc8cee80>
  Migration:
  class CreateFeedbacks < ActiveRecord::Migration
  def change
  create_table :feedbacks do |t|
  t.references :user
  t.text :body
  t.timestamps
  end
  respond_to do |format|
  if @feedback.save
  format.html { redirect_to @user, notice 'Comment was successfully created.' }
  format.json { render json: @feedback, status: :created, location: @feedback }
  else
  format.html { render action: "new" }
  format.json { render json: @feedback.errors, status: :unprocessable_entily }
  end
  end
  Firstly, it helps a lot to style your question and code correctly as well as mark your files (
  routes.rb,
  controllers,
  models correctly). Else it would be very difficult for readers to understand your question and spot issues with your code. You can refer to for the styleguide/ markdown.
  Secondly, it looks like your
  routes.rb are incorrect - but again, this could be due to your formatting. Based on your question, it looks like your routes are:
  resources :feedbacks resources :users do resources :feedbacks end end
  When it should be:
  resources: users do resources: feedbacks end
  Thirdly, your seem to have a typo in your model (
  feedback instead of
  feedbacks. That is:
  class User < ActiveRecord::Base has_many :feedbacks end class Feedback < ActiveRecord::Base belongs_to :user end
  Lastly, do add specifics and what exactly you ran that caused the error. E.g. did you run something in console, what page did you load?