This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/app/controllers/invitations.rb

25 lines
733 B
Ruby
Raw Permalink Normal View History

2008-06-27 00:13:15 -04:00
class Invitations < Application
def new
only_provides :html
@invitation = Invitation.new(params[:invitation])
@secondary_title = 'Invite your friends!'
render
end
def create
@invitation = Invitation.new(params[:invitation])
if @invitation.save
m = Merb::Mailer.new :to => @invitation.recipient,
:from => 'invitations@penguincoder.org',
:subject => 'TuxBliki Invitation!',
:body => partial('invitation', :format => 'text')
m.deliver!
flash[:notice] = "You just sent an invitation!"
redirect url(:authors)
else
@secondary_title = 'Invite your friends!'
render :new
end
end
end