Sha256: 9f8f58ab135771a56cc5889d7436c723ee1b10814403654431a0d7b28e2db167

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

module Spree
  class NewslettersController < StoreController
    def create
      @newsletter = Spree::Newsletter.new(newsletter_params)

      if @newsletter.save
        flash[:success] = Spree.t(:'newsletter.controller.success')
      else
        flash[:error] = Spree.t(:'newsletter.controller.error')
      end

      redirect_to admin_newsletters_edit_path
    end

    private

    def newsletter_params
      params.require(:newsletters).permit(:name, :email)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_newsletter-1.0 app/controllers/spree/newsletters_controller.rb