Class: AlchemyCrm::SubscriptionsController

Inherits:
BaseController
  • Object
show all
Includes:
I18nHelpers
Defined in:
app/controllers/alchemy_crm/subscriptions_controller.rb

Instance Method Summary collapse

Methods included from I18nHelpers

#alchemy_crm_t, #i18n_t, included, #translate_model_attribute

Instance Method Details

#createObject



17
18
19
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 17

def create
  
end

#destroyObject



29
30
31
32
33
34
35
36
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 29

def destroy
  @subscription = @contact.subscriptions.find(params[:subscription_id])
  @subscription.destroy
  flash[:notice] = alchemy_crm_t(:subscription_destroyed)
  @page = Alchemy::Page.find_by_page_layout('newsletter_views')
  @root_page = @page.get_language_root
  render :template => 'alchemy/pages/show', :layout => layout_for_page
end

#editObject



21
22
23
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 21

def edit

end

#indexObject



7
8
9
10
11
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 7

def index
  @page = Alchemy::Page.find_by_page_layout('newsletter_views')
  @root_page = @page.get_language_root
  render :template => 'alchemy/pages/show', :layout => layout_for_page
end

#newObject



13
14
15
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 13

def new

end

#overviewObject



38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 38

def overview
  @contact = Contact.find_by_email(params[:email])
  if @contact
    SubscriptionsMailer.overview_mail.deliver(@contact, @element)
    flash[:notice] = alchemy_crm_t(:send_subscriptions_overview_via_email)
    redirect_to :index
  else
    flash[:error] = alchemy_crm_t(:no_subscriber_found)
    render :index
  end
end

#updateObject



25
26
27
# File 'app/controllers/alchemy_crm/subscriptions_controller.rb', line 25

def update
  
end