Class: InvitationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/invitations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/invitations_controller.rb', line 8

def create

  if params[:mails].present?
    receivers = params[:mails].split(/, */)
    if are_valid_emails?(receivers)
      receivers.each do |receiver|
        InvitationMailer.send_invitation(receiver, current_subject, params[:message]).deliver
      end
      render :action => :new, :locals => {:flash => { :success => t('invitation.success')}}
      return
    end
  end
  render :action => :new, :locals => {:flash => { :error => t('invitation.error')}}

end

#newObject



4
5
6
# File 'app/controllers/invitations_controller.rb', line 4

def new

end