class ActionDispatch::Routing::Mapper

Public Instance Methods

two_factor_auth_for(resource) click to toggle source
# File lib/two_factor_auth.rb, line 157
def two_factor_auth_for resource
  begin
    klass = resource.to_s.classify.constantize
  rescue NameError
    warn "You included two_factor_auth_for #{resource.inspect} in your routes but there is no model defined in your system"
  end
  namespace :two_factor_auth do
    resources(:registrations,   only: [:new, :create])
    resource(:authentication,   only: [:new, :create])
    resources(:trusted_facets,  only: [:index])
  end
end