Class: NewslettersController

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

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
# File 'app/controllers/newsletters_controller.rb', line 3

def create
  if Newsletter.find_or_create_by_email(params[:newsletter])
    flash[:notice] = t('newsletter.subscribe.success')
  else
    flash[:error] = t('newsletter.subscribe.failed')
  end
  redirect_to :back
end