title: Param is missing or the value is empty: ParameterMissing in ResultsController#update
body: <p>I have a Result that belongs to a Website. After I create the website I also create the result and redirect to its edit page. Here I want to add some more values. </p>
  
  <p>My problem is: When I try to update my Result, then I get:</p>
  
  <pre><code>param is missing or the value is empty: result
  
  
      Request
  
      Parameters:
  
      {"utf8"=&gt;"✓",  "_method"=&gt;"patch",  "authenticity_token"=&gt;"GRN/y/04Qbsm9DzlUAbUYF8ZSv2EMHnRZgBZY/6GMDlOBdq8V5Uncij9VRp51uydC6M/qc61jPWwpUehSuc5xA==", "data"=&gt;["//html/body/div[position() = 3]/ul/li[position() = 16]/ul/li[position() = 2]/child::text()",  "//html/body/div[position()
      = 3]/ul/li[position() = 16]/ul/li[position() = 2]/p/a/child::text()",  "//html/body/div[position() = 3]/ul/li[position() = 16]/ul/li[position() = 4]/child::text()",  "//html/body/div[position()
      = 3]/ul/li[position() = 16]/ul/li[position() = 5]/a/child::text()"],  "commit"=&gt;"Update Result",  "id"=&gt;"66"}
  </code></pre>
  
  <p>This is how my Result params looks like</p>
  
  <pre><code>def result_params
        params.require(:result).permit(:data)
      end
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>class Result &lt; ActiveRecord::Base
    belongs_to :website
    attr_accessor :website_id
    attr_accessor :data
  
    serialize :data, Array
  end
  </code></pre>
  
  <p>Here is my controller code:</p>
  
  <pre><code>    class ResultsController &lt; ApplicationController
    before_action :set_result, only: [:show, :edit, :update, :destroy]
  
    # GET /Results
    # GET /Results.json
    def index
      @results = Result.all
    end
  
    # GET /Results/1
    # GET /Results/1.json
    def show
    end
  
    # GET /Results/new
    def new
      @result = Result.new
    end
  
    # GET /Results/1/edit
    def edit
      @result = Result.find(params[:id])
    end
  
    # POST /Results
    # POST /Results.json
    def create
      @result = Result.new(result_params)
  
      respond_to do |format|
        if @result.save
          format.html { redirect_to @result, notice: 'Result was successfully created.' }
          format.json { render :show, status: :created, location: result }
        else
          format.html { render :new }
          format.json { render json: @result.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PATCH/PUT /Results/1
    # PATCH/PUT /Results/1.json
    def update
      respond_to do |format|
        if @result.update(result_params )
          format.html { redirect_to @result, notice: 'Result was successfully updated.' }
          format.json { render :show, status: :ok, location: @result }
        else
          format.html { render :edit }
          format.json { render json: @result.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # DELETE /Results/1
    # DELETE /Results/1.json
    def destroy
      @result.destroy
      respond_to do |format|
        format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
  
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_result
        @result = Result.find(params[:id])
      end
  
      # Never trust parameters from the scary internet, only allow the white list through.
      def result_params
        params.permit(:data =&gt; [])
      end
  end
  </code></pre>
  
  <p>My view:</p>
  
  <pre><code>&lt;%= form_for(@result) do |f| %&gt;
    &lt;% if @result.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h2&gt;&lt;%= pluralize(@result.errors.count, "error") %&gt; prohibited this result from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% @result.errors.full_messages.each do |message| %&gt;
          &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
  
      &lt;div class="field"&gt;
        &lt;% if @result.website.url != nil %&gt;
        &lt;%= atts = get_all_elements(@result.website.url)%&gt;
            &lt;% atts.each do |p| %&gt;
                &lt;div&gt;
                  &lt;%= check_box_tag "data[]", get_xpath_from_node(p)%&gt;
                  &lt;%= p.text %&gt;
                &lt;/div&gt;
            &lt;%end%&gt;
        &lt;% end%&gt;
      &lt;/div&gt;
  
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>And this is the place where i call the edit result page:</p>
  
  <pre><code>def update
      respond_to do |format|
        if @website.update(website_params)
          format.html { redirect_to @website, notice: 'Website was successfully updated.' }
          format.json { render :show, status: :ok, location: @website }
        else
          format.html { render :edit }
          format.json { render json: @website.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>
  
  <p>Ive allready tryed every solution I could find, but none of them seemed to work for me. </p>