title: Rails unpermitted parameters files when uploading using carrierwave
body: <p>I am trying to upload using carrierwave but I am facing an error ..when i select the file and click on upload still it says <strong>it can't be blank</strong> and on console it says <strong>unpermitted parameters files</strong> .<br>
  [upload_controller.rb]</p>
  
  <pre><code>class UploadsController &lt; ApplicationController
    before_action :authenticate_user! 
  
    def index
      @uploads=Upload.all
    end
  
    def new
      @upload=Upload.new
    end
  
  
    def create
  
      @upload=Upload.new(params_abc)
  
       if  @upload.save
          Upload.upload(params[:upload][:files])  
          redirect_to  @upload
       else
         render 'new'
       end
  
    end
  
  private
  
    def params_abc
          params.require(:upload).permit(:title,:description)
    end
  
  end
  </code></pre>
  
  <p><br></p>
  
  <p>[upload.rb]
  <br></p>
  
  <pre><code>class Upload &lt; ActiveRecord::Base
  
      validates :description,  presence: true
      validates :title,  presence: true
      validates :tageline, presence: true
  
      mount_uploader :upload, UploadUploader 
  
      def self.upload(files)  
          files.each do |file|    
          #@file_extension=file.content_type.split('/')[1]            
  
              doc = Upload.new(tageline: file )
              #save is a method which will save the content in the database 
              doc.save!
          end
      end
  
  end
  </code></pre>
  
  <p><br>
  [uploads/new.html.erb]
  <br></p>
  
  <pre><code>&lt;%= form_for @upload,html: { multipart: true } do |f| %&gt;
      &lt;% if @upload.errors.any? %&gt;
          &lt;div id="errors"&gt;
              &lt;h2&gt;&lt;%= pluralize(@upload.errors.count, "error") %&gt; prevented this post from saving:&lt;/h2&gt;
              &lt;ul&gt;
                  &lt;% @upload.errors.full_messages.each do |msg| %&gt;
                      &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
                  &lt;% end %&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;% end %&gt;
  
      &lt;%= f.label :title %&gt;&lt;br&gt;
      &lt;%= f.text_field :title %&gt;&lt;br&gt;
      &lt;br&gt;
  
      &lt;%= f.label :description %&gt;&lt;br&gt;
      &lt;%= f.text_field :description %&gt;&lt;br&gt;
  
       &lt;br&gt;
  
  
  
      &lt;%= f.label :files %&gt;&lt;br&gt;
      &lt;%= f.file_field :files%&gt;&lt;br&gt;
      &lt;br&gt;
  
      &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><br>
  [upload_migration]</p>
  
  <pre><code>class CreateUploads &lt; ActiveRecord::Migration
    def change
      create_table :uploads do |t|
          t.string :title, null: false
          t.string :description, null: false
          t.string :tageline, null: false
          t.timestamps
      end
    end
  end
  </code></pre>
  
  <p><br>
  [console]
  <br></p>
  
  <pre><code>Started POST "/uploads" for 127.0.0.1 at 2016-02-08 14:18:54 +0530
  Processing by UploadsController#create as HTML
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"1YaRS4BPwg6W5RaKNs/BOCf24TezALQWuxEEhjz04nY=", "upload"=&gt;{"title"=&gt;"mjkhhjkkj", "description"=&gt;"jhhjnh", "files"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x000000053ec6c8 @tempfile=#&lt;Tempfile:/tmp/RackMultipart20160208-10624-40whhz&gt;, @original_filename="Design Patterns in Ruby (2007).pdf", @content_type="application/pdf", @headers="Content-Disposition: form-data; name=\"upload[files]\"; filename=\"Design Patterns in Ruby (2007).pdf\"\r\nContent-Type: application/pdf\r\n"&gt;}, "commit"=&gt;"Create Upload"}
    User Load (0.3ms)  SELECT  `users`.* FROM `users`  WHERE `users`.`id` = 4  ORDER BY `users`.`id` ASC LIMIT 1
  Unpermitted parameters: files
     (0.1ms)  BEGIN
     (0.1ms)  ROLLBACK
    Rendered uploads/new.html.erb within layouts/application (2.7ms)
  Completed 200 OK in 86ms (Views: 82.3ms | ActiveRecord: 0.5ms)
  </code></pre>
  
  <p><br>
  [tageline_uploader]
  <br></p>
  
  <pre><code># encoding: utf-8
  
  class TagelineUploader &lt; CarrierWave::Uploader::Base
  
    # Include RMagick or MiniMagick support:
    # include CarrierWave::RMagick
    # include CarrierWave::MiniMagick
  
    # Choose what kind of storage to use for this uploader:
    storage :file
    # storage :fog
  
    # Override the directory where uploaded files will be stored.
    # This is a sensible default for uploaders that are meant to be mounted:
    def store_dir
      "uploadss/post/#{model.id}"  
    end
  
    # Provide a default URL as a default if there hasn't been a file uploaded:
    # def default_url
    #   # For Rails 3.1+ asset pipeline compatibility:
    #   # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
    #
    #   "/images/fallback/" + [version_name, "default.png"].compact.join('_')
    # end
  
    # Process files as they are uploaded:
    # process :scale =&gt; [200, 300]
    #
    # def scale(width, height)
    #   # do something
    # end
  
    # Create different versions of your uploaded files:
    # version :thumb do
    #   process :resize_to_fit =&gt; [50, 50]
    # end
  
    # Add a white list of extensions which are allowed to be uploaded.
    # For images you might use something like this:
    # def extension_white_list
    #   %w(jpg jpeg gif png)
    # end
  
    # Override the filename of the uploaded files:
    # Avoid using model.id or version_name here, see uploader/store.rb for details.
    # def filename
    #   "something.jpg" if original_filename
    # end
  
  end
  </code></pre>