Class: Devise::DisplayqrController

Inherits:
DeviseController
  • Object
show all
Includes:
Controllers::Helpers
Defined in:
app/controllers/devise/displayqr_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
# File 'app/controllers/devise/displayqr_controller.rb', line 6

def show
  if not resource.nil? and not resource.gauth_secret.nil?
    render :show
  else
     scope, resource, :bypass => true
    redirect_to stored_location_for(scope) || :root
  end
end

#updateObject



15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/devise/displayqr_controller.rb', line 15

def update
  tmp = params[resource_name]
  if resource.set_gauth_enabled(params[resource_name])
    set_flash_message :notice, "Status Updated!"
     scope, resource, :bypass => true
    redirect_to stored_location_for(scope) || :root
  else
    render :show
  end
end