Sha256: 3d75ecc8ecc3cef6c8ba62376fc4cbd0a877f8ddd6ff5a0e1440d979f77cfee5

Contents?: true

Size: 714 Bytes

Versions: 27

Compression:

Stored size: 714 Bytes

Contents

module DeviseInvitable
  module Controllers
    module UrlHelpers
      [:path, :url].each do |path_or_url|
        [nil, :new_, :accept_].each do |action|
          class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
            def #{action}invitation_#{path_or_url}(resource, *args)
              resource = case resource
                when Symbol, String
                  resource
                when Class
                  resource.name.underscore
                else
                  resource.class.name.underscore
              end
              
              send("#{action}\#{resource}_invitation_#{path_or_url}", *args)
            end
          URL_HELPERS
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
devise_invitable-1.0.0 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.6.1 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.6.0 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.7 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.6 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.5 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.4 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.3 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.2 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.1 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.5.0 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.2 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.1 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.3.7 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.0 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.rc5 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.rc4 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.rc3 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.3.6 lib/devise_invitable/controllers/url_helpers.rb
devise_invitable-0.4.rc2 lib/devise_invitable/controllers/url_helpers.rb