Rails let user upload photo with carrierwave
<p>I have entity <code>Lead</code>. I want to be able to upload a picture and save its path to <code>status_photo</code> field. I use <code>carrierwave</code> gem for photo uploads.</p>

<p>In my model I've mounted <code>mount_uploader :status_photo, PhotoUploader</code> (My photouploader definitely works so the problem with code in my controller or view)</p>

<p>Right now I have a form for editing my lead.</p>

<pre><code>&lt;%= form_for(@lead) do |f| %&gt;

    phone: &lt;%= @lead.phone %&gt;
    .
    .
    .

   status: &lt;%= select_tag(:status, options_for_select([['0', 0], ['1', 1]], selected: @lead.status )) %&gt;

   photo of car repair process:

   &lt;%= f.file_field :status_photo   %&gt;&lt;br/&gt;

  &lt;%= f.submit "Save changes" %&gt;
  &lt;% end %&gt;
</code></pre>

<p>In my controller I have:</p>

<pre><code>        def update
        @lead = Lead.find(params[:id])

        if @lead.update_attributes(status: params[:status], status_photo: params[:status_photo] )
          flash[:success] = "Information updated"
          redirect_to leads_url
        else
          render 'edit'
        end
      end
</code></pre>

<p>As you can see I also update status field which is updated fine but status_photo doesn't. What do I do?</p>