Sha256: 975187f669e4677157be3ea671371c7b53f52643cdd2f79970767e0d12b73b0f
Contents?: true
Size: 592 Bytes
Versions: 9
Compression:
Stored size: 592 Bytes
Contents
class IshManager::FriendsController < IshManager::ApplicationController def index authorize! :friends_index, IshModels::UserProfile @new_friend = IshModels::UserProfile.new end def create @friend = ::IshModels::UserProfile.find_by :email => params[:friend][:email] puts! @friend, 'friend!' authorize! :friends_new, @friend me = current_user.profile me.friends << @friend if me.save flash[:notice] = 'Added Friend' else flash[:alert] = "Cannot add friend: #{me.errors.messages}" end redirect_to :action => 'index' end end
Version data entries
9 entries across 9 versions & 1 rubygems