Skip to content
This repository
Newer
Older
100644 35 lines (30 sloc) 1.165 kb
02e8c04c » josevalim
2010-02-17 Update views generator and now have scoped views.
1 class Devise::UnlocksController < ApplicationController
a5ba2ac1 » carlosantoniodasilva
2010-03-26 Use prepend_before_filter in require_no_authentication.
2 prepend_before_filter :require_no_authentication
b581f863 » josevalim
2010-01-13 DRY up controllers.
3 include Devise::Controllers::InternalHelpers
8a15ac6e » josevalim
2010-02-08 Stub out other views for Registerable.
4
5 # GET /resource/unlock/new
6 def new
0aa41d63 » josevalim
2010-07-13 Tidy up lose ends.
7 build_resource({})
8a15ac6e » josevalim
2010-02-08 Stub out other views for Registerable.
8 render_with_scope :new
9 end
10
11 # POST /resource/unlock
12 def create
13 self.resource = resource_class.send_unlock_instructions(params[resource_name])
14
61992520 » Rodrigo Flores
2011-06-22 Refactored paranoid mode actions for it to appear once
15 if successful_and_sane?(resource)
16 set_flash_message :notice, :send_instructions if is_navigational_format?
308238ab » Rodrigo Flores
2011-06-22 Not responding the object on creating unlockable requests
17 respond_with({}, :location => new_session_path(resource_name))
40c0a7b5 » Rodrigo Flores
2011-06-20 Added paranoid mode to lockable
18 else
61992520 » Rodrigo Flores
2011-06-22 Refactored paranoid mode actions for it to appear once
19 respond_with_navigational(resource){ render_with_scope :new }
8a15ac6e » josevalim
2010-02-08 Stub out other views for Registerable.
20 end
21 end
d2fa737a » mhfs
2009-12-30 introducing lockable implementation
22
23 # GET /resource/unlock?unlock_token=abcdef
24 def show
ac742e32 » josevalim
2010-03-10 Clean up lockable and class methods API.
25 self.resource = resource_class.unlock_access_by_token(params[:unlock_token])
d2fa737a » mhfs
2009-12-30 introducing lockable implementation
26
27 if resource.errors.empty?
210bc6aa » sikachu
2011-01-16 Add support for non-navigational formats in UnlocksController
28 set_flash_message :notice, :unlocked if is_navigational_format?
29 sign_in(resource_name, resource)
5b94d9b8 » josevalim
2011-03-30 Refactor a bit navigational format responses, to not call to_sym and …
30 respond_with_navigational(resource){ redirect_to redirect_location(resource_name, resource) }
d2fa737a » mhfs
2009-12-30 introducing lockable implementation
31 else
5b94d9b8 » josevalim
2011-03-30 Refactor a bit navigational format responses, to not call to_sym and …
32 respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render_with_scope :new }
d2fa737a » mhfs
2009-12-30 introducing lockable implementation
33 end
34 end
35 end
Something went wrong with that request. Please try again.