Sha256: 08b830b6eef424900b39deaf67608a6dad9bf97437c7f2035925b15112c04cf0
Contents?: true
Size: 718 Bytes
Versions: 11
Compression:
Stored size: 718 Bytes
Contents
require 'securerandom' module DeviseMasquerade module Controllers module UrlHelpers def masquerade_path(resource, *args) scope = Devise::Mapping.find_scope!(resource) opts = args.shift || {} opts[:masqueraded_resource_class] = resource.class.name opts[Devise.masquerade_param] = resource.masquerade_key send("#{scope}_masquerade_index_path", opts, *args) end def back_masquerade_path(resource, *args) scope = Devise::Mapping.find_scope!(resource) opts = args.first || {} opts[:masqueraded_resource_class] = resource.class.name send("back_#{scope}_masquerade_index_path", opts, *args) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems