Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -> /app/models/user.rb
- class User < ActiveRecord::Base
- devise :database_authenticatable, :registerable, :recoverable, :trackable, :validatable
- attr_accessible :email, :password,
- :password_confirmation,
- :remember_me,
- :fname,
- :lname,
- :bday,
- :address,
- :areacode,
- :city,
- :education,
- :info,
- :looking_for,
- :tele
- has_attached_file :photo
- end
- -> Upload code
- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :multipart => true }) do |f| %>
- <div class="field">
- <%= f.file_field :photo %>
- </div>
- -> Show code
- <%= image_tag @user.photo.url %>
Add Comment
Please, Sign In to add comment