2009-01-15 12:14:01 +01:00
|
|
|
class FoodcoopController < ApplicationController
|
|
|
|
|
2009-08-02 19:01:45 +02:00
|
|
|
before_filter :authenticate_membership_or_admin
|
2009-01-15 12:14:01 +01:00
|
|
|
|
|
|
|
# Invites a new user to join foodsoft in this group.
|
|
|
|
def invite
|
|
|
|
@invite = Invite.new
|
|
|
|
end
|
2009-08-02 18:42:52 +02:00
|
|
|
|
2009-01-15 12:14:01 +01:00
|
|
|
# Sends an email
|
|
|
|
def send_invitation
|
|
|
|
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
|
|
|
|
if @invite.save
|
|
|
|
flash[:notice] = format('Es wurde eine Einladung an %s geschickt.', @invite.email)
|
2009-02-01 23:09:03 +01:00
|
|
|
redirect_to root_path
|
2009-01-15 12:14:01 +01:00
|
|
|
else
|
|
|
|
render :action => 'invite'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|