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
@person = current_user.visible_person_by_id(params[:id])
@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'

View file

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