Skip to content

Instantly share code, notes, and snippets.

@tubbo
Forked from ArunGupta25/albums_controller.rb
Created June 11, 2012 21:15
Show Gist options
  • Select an option

  • Save tubbo/2912751 to your computer and use it in GitHub Desktop.

Select an option

Save tubbo/2912751 to your computer and use it in GitHub Desktop.
def tagged
if current_user
@fb_user = FbGraph::User.me(current_user.fb_token)
@photos_of_you = @fb_user.photos({"limit" => "0"})
@count = @photos_of_you.count
end
render :layout => false
end
<% if current_user %>
<% @photos_of_you.each do |photo| %>
<input type="image" id='<%= photo.identifier %>' class="edit-photo" src='<%= photo.raw_attributes["picture"] %>' data-source="<%= photo.raw_attributes["source"] %>" value="Edit photo" />
<% end %>
<% else %>
<h1>You are not logged in!</h1>
<% end %>
$('.edit-photo').click(function(event) {
event.preventDefault(); event.stopPropagation();
launchEditor($(this).attr('id'), $(this).data('source'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment