Sha256: 141f6653769abde217aaa9c3d6c5b43d6e5a786bbd3d8358b025525eb2edae01

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

MailyHerald::Engine.routes.draw do
  get ":token", to: "tokens#get", as: :token
end

MailyHerald::Engine.routes.url_helpers.class.module_eval do
  def maily_unsubscribe_url(subscription, *args)
    options = args.extract_options! || {}
    options = options.reverse_merge({controller: "/maily_herald/tokens", action: "get", token: subscription.token}.merge(Rails.application.routes.default_url_options))

    MailyHerald::Engine.routes.url_helpers.url_for(options)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maily_herald-0.9.3 config/routes.rb
maily_herald-0.9.2 config/routes.rb
maily_herald-0.9.1 config/routes.rb