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.1.26 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.25 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.24 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.23 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.22 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.21 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.2 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.1 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.1.0 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.17 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1667 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1666 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1665 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1664 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1663 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1662 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.1661 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.166 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.165 lib/devise_phone/controllers/url_helpers.rb
devise_phone-0.0.164 lib/devise_phone/controllers/url_helpers.rb