Class: MailAdminController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mail_admin_controller.rb

Instance Method Summary collapse

Instance Method Details

#edit_admin_messageObject



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

def edit_admin_message
	if request.post?
           @adminmessage = AdminMessage.find(params[:id])
           if @adminmessage.update_attributes(params[:adminmessage])
              if @adminmessage.save
              	flash[:notice] = 'The admin message was successfully edited.'
              	session[:user] = User.find session[:user].id
              	redirect_to :controller => 'mailinglist', 
                           :action => 'show', 
                           :id => params[:id]
              end
           end
       else
         @adminmessage = AdminMessage.find(params[:id])
    end
end

#list_admin_messagesObject



2
3
4
5
# File 'app/controllers/mail_admin_controller.rb', line 2

def list_admin_messages
	@mailinglist = Mailinglist.find_by_id(params[:id])
	@adminmessages = AdminMessage.find(@mailinglist.welcome_admin_message_id, @mailinglist.confirmed_admin_message_id, @mailinglist.sayonara_admin_message_id)
end

#new_admin_messageObject



24
25
26
# File 'app/controllers/mail_admin_controller.rb', line 24

def new_admin_message
	
end

#remove_admin_messageObject



28
29
# File 'app/controllers/mail_admin_controller.rb', line 28

def remove_admin_message
end