#118 new
Randy Harmon

"Change Profile Photo" broken @ developer site

Reported by Randy Harmon | December 21st, 2008 @ 01:50 PM

  1. Log into developer site for insoshi
  2. Click Profile
  3. Click Change Photo

Expected: allow me to upload a photo Actual: Profile page is loaded again

Comments and changes to this ticket

  • Michael Hartl

    Michael Hartl December 21st, 2008 @ 02:48 PM

    • State changed from “new” to “invalid”

    The way to change your photo it to upload a new image to your primary gallery and then select it as your avatar photo. This is the same basic flow used by Facebook.

  • Randy Harmon

    Randy Harmon December 21st, 2008 @ 04:48 PM

    Thanks for looking at this, Michael. The general model sounds okay... "Least surprise" indicates to me that there's a remaining problem in the interaction here. In particular, it seems unlikely to me that Facebook offers a "change photo" link that does nothing.

    The goal I'm expressing here is to make it dead simple for one of the basic activities that new users of Insoshi would want to do. Personalization is a key factor in user engagement, and this goes both for project contributors as well as for users of applications built on the platform.

    Maybe this means that the "change photo" link needs to point to a help page providing those instructions, or maybe it needs to point to the primary gallery with a flash message indicating that the user should select one of the images to achieve their goal. Oh, there's no primary gallery until I make one. Hm, separate issue. Make one automatically for the user? Or wait until they do want to add a photo?

    Here's the simplest thing I can brainstorm: Create Primary gallery automatically when the user signs up. Link the user from profile's "Change Photo" to that gallery's Add Photo form (if it has no photos) or to its index page with a flash message (if it does have photos). Easily done with a /profile/change_photo (or similar) action, right?

    In the Add Photo form case, include a hidden field and an onscreen message indicating that they're creating or changing their avatar photo. Again, simple but a very effective way to welcome the new user into the Insoshi (or Insoshi-based) network.

    Will you consider re-opening?

  • Michael Hartl

    Michael Hartl December 21st, 2008 @ 05:41 PM

    • Assigned user changed from “Insoshi” to “Michael Hartl”
    • State changed from “invalid” to “new”

    An older version of the code was simpler, but the photo galleries (from a contributor) changed the model. I agree that it should be clearer. In our defense, it's almost exactly the same as Facebook, and Facebook does, indeed, have a link that does basically nothing. It appears when you hover over your profile photo, and leads to the gallery of profile photos. You then have to click on another link called "Change Profile Picture", realize that that doesn't let you pick from your gallery, then click back on a gallery photo and notice the link on the bottom right that says "Make Profile Picture".

    I haven't had a lot of bandwidth for the Insoshi developer site lately, but I'll reopen the ticket as a reminder to take another look at this when I have some time.

  • Thomas

    Thomas January 21st, 2009 @ 05:04 AM

    In one of my Insoshi-based apps, I completely separated the profile picture from the galleries. I think it's much easier for a new user to manage it's avatar this way.

    I wrote this in the people_controller to do it simply.

    @@@ruby def change_photo

    @person = current_person
    if request.get?
      @photo = Photo.new
      respond_to do |format|
        format.html
      end
    elsif request.post?
      photo_data = params[:photo].merge(:owner => current_person)
      @photo = Photo.new(photo_data)
    
      respond_to do |format|
        if @photo.update_attributes(:avatar => true)
          # this destroys the first avatar
          # the new photo is then the only avatar for this person
          @person.photo.destroy
          flash[:success] = "Photo successfully changed"
          format.html { redirect_to home_url }
        else
          flash[:notice] = "Photo couldn't be changed"
          format.html
        end
      end
    else
      respond_to do |format|
        format.html { redirect_back_or_default(home_url) }
      end
    end
    
    

    end

    
    
  • Dan Paul

    Dan Paul April 6th, 2009 @ 12:03 AM

    Simple work around is to create a default gallery for them after they sign up called "My Photos" that way after they sign up and click change photo it goes to their default gallery and allows them to add photos below is the code. Feel free to add input.

    models > person.rb

    around line 120 add :create_default_gallery like so:

     after_create :connect_to_admin, :create_default_gallery
    
    

    around line 444 after

    def connect_to_admin
      # Find the first admin created.
      # The ununitiated should Google "tom myspace".
      tom = Person.find_first_admin
      unless tom.nil? or tom == self
        Connection.connect(self, tom)
      end
    end
    
    

    add the following below:

    def create_default_gallery
        self.galleries.create(:title => "My Photos")
    end
    
    

    Hope this helps anyone. thanks for all your work Micheal, your book RailsSpace got me started on Ruby, best purchase ever.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages