Don't try to put yourself in any groups

This commit is contained in:
danielvincent 2010-08-26 17:34:06 -07:00
parent 435db1ecb1
commit 390bf24e14
2 changed files with 11 additions and 15 deletions

View file

@ -14,11 +14,9 @@ class PeopleController < ApplicationController
def show def show
@person = current_user.visible_person_by_id(params[:id]) @person = current_user.visible_person_by_id(params[:id])
@profile = @person.profile @profile = @person.profile
@person_groups = current_user.groups_with_person(@person)
@groups_array = current_user.groups.collect{|x| [x.to_s, x.id]}
@groups_with_person = current_user.groups_with_person(@person)
@all_groups = current_user.groups.collect{|x| [x.to_s, x.id]}
@posts = Post.where(:person_id => @person.id, :_id.in => current_user.visible_post_ids).paginate :page => params[:page], :order => 'created_at DESC' @posts = Post.where(:person_id => @person.id, :_id.in => current_user.visible_post_ids).paginate :page => params[:page], :order => 'created_at DESC'

View file

@ -13,17 +13,15 @@
-unless @posts.first.nil? -unless @posts.first.nil?
%li %li
%i= "last seen: #{how_long_ago(@posts.first)}" %i= "last seen: #{how_long_ago(@posts.first)}"
%li - unless @person == current_user.person
%i= "friends since: #{how_long_ago(@person)}" %li
%li %i= "friends since: #{how_long_ago(@person)}"
="groups: #{@person_groups}" %li
= "edit" = form_tag move_person_path
= @groups_array.inspect = select :to, :to, @all_groups
= form_tag move_person_path = hidden_field_tag :from, :from, :value => @groups_with_person.first.id
= select :to, :to, @groups_array = hidden_field_tag :friend_id, :friend_id, :value => @person.id
= hidden_field_tag :from, :from, :value => @person_groups.first.id = submit_tag "save"
= hidden_field_tag :friend_id, :friend_id, :value => @person.id
= submit_tag "save"
%li %li
url: url:
= @person.url = @person.url