Guest User

Untitled

a guest
Feb 21st, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def picture
  2. @user = User.find(params[:id])
  3. if !(@user.picture.nil? or @user.picture.empty?)
  4. send_data(@user.picture, :filename => "photo.gif", :type => "image/gif", :disposition => "inline")
  5. else
  6. send_file(File.dirname(__FILE__) + "/../../public/images/participant_silhouette.gif", :filename => 'photo.gif', :type => 'image/gif', :disposition => 'inline')
  7. end
  8. end
Add Comment
Please, Sign In to add comment