param is missing or the value is empty

bootsa

I am new to Rails. Getting the error below. I understand what the issue is, but not sure how to fix it?

Error - param is missing or the value is empty: customer

  def customer_params
      params.require(:customer).permit(
        :first_name, 
        :last_name, 
        :email, 
        :password, 
        :password_confirmation)
    end
   end

DetailsController.rb

 class My::Account::DetailsController < MyController

 def show
   @customer = current_user
 end

 def update
   @customer = current_user
   @customer.update_attributes(customer_params)
   if @customer.errors.any?
     render :action => :show
   else
     redirect_to my_account_details_path, :notice => 'Account details updated'
   end
    end

   private

   def customer_params
      params.require(:customer).permit(
        :first_name, 
        :last_name, 
        :email, 
        :password, 
        :password_confirmation)
    end
   end

View

 .account.container
.row
    = render :partial => '/my/account/sidebar'
    .section
        %h2 Your account details

        = simple_form_for @customer, :url => my_account_details_path, :method => :put, :html => { :class => 'form-horizontal'} do |form|
            .field
                = form.input :first_name

            .field
                = form.input :last_name

            .field
                = form.input :email, :as => :email

            %hr
            %h4 Leave password fields blank to keep the existing password
            %hr

            .field
                = form.input :password, :input_html => { :value => '' }
            .field
                = form.input :password_confirmation, :input_html => { :value => '' }

            .field-actions
                %button.btn.btn-primary{type: "submit"} Save
CWitty

It is because it is coming through as user and not customer. Which I believe is because you are using current_user which is a User and not a Customer (guessing from the code). Change it to be params.require(:user).permit(blah)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

param is missing or the value is empty?

From Dev

param is missing or the value is empty for:

From Dev

ParameterMissing param is missing or the value is empty

From Dev

param is missing or the value is empty for: quotes

From Dev

param is missing or the value is empty error

From Dev

param is missing or the value is empty: user

From Dev

Param is missing or the value is empty for: contact

From Dev

param is missing or the value is empty: center

From Dev

param is missing or the value is empty on creation

From Dev

param is missing or the value is empty: comment

From Dev

Param is missing or the value is empty ROR

From Dev

param is missing or the value is empty: breads

From Dev

param is missing or the value is empty: conversation

From Dev

param is missing or the value is empty: sale

From Dev

Rails 4.0 param is missing or the value is empty

From Dev

ActionController::ParameterMissing (param is missing or the value is empty: film):

From Dev

Test is returning param missing or value empty

From Dev

Rails: param is missing or the value is empty: article

From Dev

ActionController::ParameterMissing (param is missing or the value is empty: bid)

From Dev

Rails - param is missing or the value is empty: measure

From Dev

ActionController::ParameterMissing param is missing or the value is empty

From Dev

param is missing or the value is empty - Rails 4 Engine

From Dev

Rails: ActionController::ParameterMissing param is missing or the value is empty:

From Dev

param is missing or the value is empty: module_list

From Dev

rails error - param is missing or the value is empty: buyer

From Dev

Validation not working - param is missing or the value is empty carrierwave

From Dev

rails param is missing or the value is empty: post

From Dev

ActionController::ParameterMissing (param is missing or the value is empty: bid)

From Dev

Rails : error param is missing or the value is empty : annonce

Related Related

  1. 1

    param is missing or the value is empty?

  2. 2

    param is missing or the value is empty for:

  3. 3

    ParameterMissing param is missing or the value is empty

  4. 4

    param is missing or the value is empty for: quotes

  5. 5

    param is missing or the value is empty error

  6. 6

    param is missing or the value is empty: user

  7. 7

    Param is missing or the value is empty for: contact

  8. 8

    param is missing or the value is empty: center

  9. 9

    param is missing or the value is empty on creation

  10. 10

    param is missing or the value is empty: comment

  11. 11

    Param is missing or the value is empty ROR

  12. 12

    param is missing or the value is empty: breads

  13. 13

    param is missing or the value is empty: conversation

  14. 14

    param is missing or the value is empty: sale

  15. 15

    Rails 4.0 param is missing or the value is empty

  16. 16

    ActionController::ParameterMissing (param is missing or the value is empty: film):

  17. 17

    Test is returning param missing or value empty

  18. 18

    Rails: param is missing or the value is empty: article

  19. 19

    ActionController::ParameterMissing (param is missing or the value is empty: bid)

  20. 20

    Rails - param is missing or the value is empty: measure

  21. 21

    ActionController::ParameterMissing param is missing or the value is empty

  22. 22

    param is missing or the value is empty - Rails 4 Engine

  23. 23

    Rails: ActionController::ParameterMissing param is missing or the value is empty:

  24. 24

    param is missing or the value is empty: module_list

  25. 25

    rails error - param is missing or the value is empty: buyer

  26. 26

    Validation not working - param is missing or the value is empty carrierwave

  27. 27

    rails param is missing or the value is empty: post

  28. 28

    ActionController::ParameterMissing (param is missing or the value is empty: bid)

  29. 29

    Rails : error param is missing or the value is empty : annonce

HotTag

Archive