Michael Lombardo
Michael Lombardo

Reputation: 457

undefined method `keys' for "writing of flash message" :string

Hello Im getting this error not sure how to go about it as this is the first experience for this.

Im updating a db row and then after success it redirects and the error is highlighted over the redirect_to your_reservations_path, flash: "You have submitted your Completed Writing Document"

My controller reservation:

def update
  if @reservation.update(reservation_params)
    puts 'first'
    if reservation_params.has_key?(:completed_doc)
      puts 'second'
      @reservation.update_attributes turned_in: true
      redirect_to your_reservations_path, flash: "You have submitted your Completed Writing Document"
    else

      redirect_to your_reservations_path, alert: "Oops, something went wrong..."
    end
  else
    render '_edit'
  end
end

Upvotes: 0

Views: 602

Answers (1)

Deepak Mahakale
Deepak Mahakale

Reputation: 23671

Try to change it to :notice

redirect_to your_reservations_path, 
            notice: "You have submitted your Completed Writing Document"

Upvotes: 2

Related Questions