title: Not able to get paperclip to upload images using devise to update user profile photo in Ruby on Rails
body: <p>I am trying to implement paperclip to allow users to update their profile image on their account. I am using devise for account creation and update but I'm a little unsure about how devise works with paperclip in order to save the image to ActiveRecord. Paperclip will allow me to select a photo and submit it but the photo will not display when I go to the show view. I am not sure if devise is saving it to active record accordingly or what the problem may be so after spending way to many hours on this feature I am coming to the StackOverflow community for help. Please help me! </p>
  
  <p>users controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
  def show
  @user = User.find(params[:id])
  end
  
  def edit
  @user = User.find(params[:id])
  end
  
  def update
  @user = User.find(params[:id])
  end
  
  def user_params
  params.require(:user).permit(:image)
  end
  
  end
  </code></pre>
  
  <p>registrations_controller</p>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
  
  private
  
  def sign_up_params
  params.require(:user).permit(:name, :email, :password, 
  :password_confirmation)
  end
  
  def account_update_params
  params.require(:user).permit(:name, :phone, :email, :image, 
  :password, :password_confirmation, :current_password)
  end
  
  end
  </code></pre>
  
  <p>edit.html.erb (devise registration view)</p>
  
  <pre><code>&lt;%= form_for (resource, as: resource_name, url: 
  registration_path(resource_name), html: { method: :put }) do |f| %&gt;
  &lt;%= devise_error_messages! %&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.file_field :image %&gt;
  &lt;/div&gt;
  ...
  </code></pre>
  
  <p>user model:</p>
  
  <pre><code>class User &lt; ApplicationRecord
  has_many :appointments
  has_many :fruits, dependent: :destroy
  has_attached_file :image, :styles =&gt; { large: "150x150&gt;", medium: 
  "100x100&gt;", thumb: "50x50#"}
  validates_attachment_content_type :image, content_type: 
  /\Aimage\/.*\Z/
  
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable, :validatable
  end
  </code></pre>
  
  <p>show view:</p>
  
  <pre><code>&lt;%= stylesheet_link_tag    "user" %&gt;
  
  &lt;h1&gt;&lt;%= @user.name %&gt;&lt;/h1&gt;
  
  &lt;div class="pic"&gt;
  &lt;%= image_tag @user.image.url(:large) %&gt;
  &lt;/div&gt;
  
  &lt;h4&gt;Phone: &lt;%= @user.phone %&gt;&lt;/h4&gt;
  &lt;h4&gt;Email: &lt;%= @user.email %&gt;&lt;/h4&gt;
  
  &lt;p&gt; 
  &lt;%= link_to "Edit Info", edit_user_registration_path(current_user) %&gt; 
  &lt;/p&gt;
  </code></pre>