title: Upload doesn't work using Carrierwave in Rails 5
body: <p>So I was working on my app and trying to put on an uploader feature.</p>
  
  <p>First I generated a course uploader and allowed jpeg, jpg, png and gif. </p>
  
  <p>Next I've added the ff code mount on my course model:</p>
  
  <pre><code>  mount_uploader :thumb_image, CoursesUploader
    mount_uploader :main_image, CoursesUploader
  </code></pre>
  
  <p>Next, I place the file upload form code on my new.html.erb file:</p>
  
  <pre><code>  &lt;div class="field"&gt;
      &lt;%= f.file_field :main_image %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
    &lt;%= f.file_field :thumb_image %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And when I tried to submit my form with my images uploaded it did not even show the index page instead I refresh the page and then see if it got uploaded and the form was submitted successfully but it did not. </p>
  
  <p>I also look at the strong params on my controller and these two items are there:</p>
  
  <pre><code>  # Never trust parameters from the scary internet, only allow the white list through.
      def course_params
        params.require(:course).permit(:title, :price, :body, :main_image, :thumb_image)
      end
  </code></pre>
  
  <p>Any idea what am I missing here?</p>
  
  <p>Here's something I got from my terminal after submission:</p>
  
  <pre><code>Started POST "/courses" for 127.0.0.1 at 2019-01-16 20:52:20 +0800
  Processing by CoursesController#create as HTML
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"wlKpv8czsuC6AZjCctxYk203wry4cb0dnOYI9IoAkzRZNV2vB4/vREU5L5u4G7vh5ZhCbHZlJ6nHPN95qO+cbA==", "course"=&gt;{"title"=&gt;"Goody", "price"=&gt;"33", "main_image"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007f81e52eed48 @tempfile=#&lt;Tempfile:/var/folders/3_/8bmsd3j13bxfdl1jp7gzvvsm0000gn/T/RackMultipart20190116-2359-17w6pb.jpg&gt;, @original_filename="61230.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"course[main_image]\"; filename=\"61230.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;, "thumb_image"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007f81e52eecd0 @tempfile=#&lt;Tempfile:/var/folders/3_/8bmsd3j13bxfdl1jp7gzvvsm0000gn/T/RackMultipart20190116-2359-2mcy4i.jpg&gt;, @original_filename="61230.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"course[thumb_image]\"; filename=\"61230.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;, "body"=&gt;""}, "commit"=&gt;"Create Course"}
     (0.5ms)  BEGIN
    ↳ app/controllers/courses_controller.rb:27
    Course Exists (1.5ms)  SELECT  1 AS one FROM "courses" WHERE "courses"."id" IS NOT NULL AND "courses"."slug" = $1 LIMIT $2  [["slug", "goody"], ["LIMIT", 1]]
    ↳ app/controllers/courses_controller.rb:27
     (0.6ms)  ROLLBACK
    ↳ app/controllers/courses_controller.rb:27
    Rendering courses/new.html.erb within layouts/application
    Rendered courses/new.html.erb within layouts/application (12.6ms)
    Rendered shared/_application_nav.html.erb (6.2ms)
    Rendered shared/_application_footer.html.erb (1.3ms)
  Completed 200 OK in 394ms (Views: 356.6ms | ActiveRecord: 2.6ms)
  </code></pre>
  
  <p>UPDATE: FULL MODEL CONTENT</p>
  
  <pre><code>class Course &lt; ApplicationRecord
    include DefaultsConcern
  
    enum status: { draft: 0, published: 1 }
    validates_presence_of :title, :price, :body, :main_image, :thumb_image
  
    mount_uploader :thumb_image, CoursesUploader
    mount_uploader :main_image, CoursesUploader
  
    extend FriendlyId
    friendly_id :title, use: :slugged
  
  end
  </code></pre>
  
  <p>FULL FORM CONTENT:</p>
  
  <pre><code>&lt;h1&gt;New Form&lt;/h1&gt;
  
  &lt;%= form_for(@course) do |f| %&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :title %&gt;
      &lt;%= f.text_field :title %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :price %&gt;
      &lt;%= f.number_field :price %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.file_field :main_image %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
    &lt;%= f.file_field :thumb_image %&gt;
  &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :body %&gt;
      &lt;%= f.text_area :body %&gt;
    &lt;/div&gt;
  
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>