Class: NewslettersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- NewslettersController
- Defined in:
- app/controllers/newsletters_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#get_login_link, #set_locale_with_config
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/newsletters_controller.rb', line 4 def create = Newsletter.new(params[:newsletter]) .email = .email.to_s.strip if .save flash[:notice] = t(:success, :scope => [:newsletter, :create]) @page = Page.find_by_single_key('inscription_reussie') else if error = .errors.on(:email) flash[:error] = t(:invalid_email, :scope => [:newsletter, :create], :error => error.last) else flash[:error] = .errors..first end end return redirect_to :back end |