Sha256: 5dff0f7ffa73ae5cfc68b64e00ec0456653d63b50e7ef4d0ab785d03fa2a9519

Contents?: true

Size: 438 Bytes

Versions: 5

Compression:

Stored size: 438 Bytes

Contents

module MailyHerald
  class TokensController < MailyHerald::ApplicationController
    def get
      @subscription = MailyHerald::Subscription.find_by_token(params[:token])
      @subscription.try(:deactivate!)

      redirect_to MailyHerald.token_redirect.try(:call, self, @subscription) || "/", 
        notice: @subscription ? t('maily_herald.subscription.deactivated') : t('maily_herald.subscription.undefined_token')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
maily_herald-0.9.4 app/controllers/maily_herald/tokens_controller.rb
maily_herald-0.9.3 app/controllers/maily_herald/tokens_controller.rb
maily_herald-0.9.2 app/controllers/maily_herald/tokens_controller.rb
maily_herald-0.9.1 app/controllers/maily_herald/tokens_controller.rb
maily_herald-0.8.0 app/controllers/maily_herald/tokens_controller.rb