Created
December 13, 2010 21:39
-
-
Save johanbrook/739643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@message = Message.new(params[:message]) | |
if @message.save | |
if session[:sent] | |
@messages = current_user.messages.sent.arrived_at_asc.paginate(:page => params[:page], :per_page => 5) | |
else | |
@messages = current_user.messages.queued.created_at_desc.paginate(:page => params[:page], :per_page => 5) | |
end | |
flash[:success] = "Mail is successfully queued and will be sent on #{@message.arrived_at}" | |
#Add to mail queue | |
else | |
flash[:failure] = "Mail was not queued, please fix the errors" | |
render :new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment