Sha256: fc814400360b4c53e337db69b565d35034a517fa46c714eb4f7d24306965468a

Contents?: true

Size: 737 Bytes

Versions: 29

Compression:

Stored size: 737 Bytes

Contents

module DevisePhone
  module Controllers
    module UrlHelpers
      [:path, :url].each do |path_or_url|
        [nil, :new_, :create_, :activate_].each do |action|
          class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
            def #{action}phone_verification_#{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}_phone_verification_#{path_or_url}", *args)
            end
          URL_HELPERS
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
devise_phone-0.0.162 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.161 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.16 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.15 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.14 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.13 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.12 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.11 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1 lib/devise_phone/controllers/url_helpers.rb