Class: ReaderActivationsController
- Inherits:
-
ReaderActionController
- Object
- ApplicationController
- ReaderActionController
- ReaderActivationsController
- Defined in:
- app/controllers/reader_activations_controller.rb
Instance Method Summary collapse
- #new ⇒ Object
-
#show ⇒ Object
this is just fake REST: we’re actually working on the reader, not an activation object.
- #update ⇒ Object
Methods inherited from ReaderActionController
#default_welcome_url, #logged_in?, #logged_in_admin?, #logged_in_user?, #permission_denied
Instance Method Details
#new ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/reader_activations_controller.rb', line 21 def new if current_reader @reader = current_reader @reader. flash[:notice] = t("reader_extension.activation_message_sent") end expires_now render :action => 'show' end |
#show ⇒ Object
this is just fake REST: we’re actually working on the reader, not an activation object. .new sends out an activation message, if we can identify the current reader .update updates the reader, if the supplied token and reader id match .show displays the activation in progress, ie it says ‘check your email’
16 17 18 19 |
# File 'app/controllers/reader_activations_controller.rb', line 16 def show expires_now render end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/reader_activations_controller.rb', line 31 def update if @reader @reader.activate! self.current_reader = @reader redirect_to default_welcome_url(@reader) else @error = t("reader_extension.please_check_message") expires_now render :action => 'show' end end |