Class: Notee::TokensController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Notee::TokensController
- Defined in:
- app/controllers/notee/tokens_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /tokens.
-
#destroy ⇒ Object
DELETE /tokens/1.
-
#new ⇒ Object
GET /tokens/new.
Instance Method Details
#create ⇒ Object
POST /tokens
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/notee/tokens_controller.rb', line 13 def create if Notee.notee_id == params[:id] && Notee.notee_password == params[:password] if token = Token.create! session[:access_token] = token.access_token end end redirect_to root_path end |
#destroy ⇒ Object
DELETE /tokens/1
24 25 26 27 |
# File 'app/controllers/notee/tokens_controller.rb', line 24 def destroy Token.find_by_access_token(session[:access_token]).destroy! session.delete(:access_token) end |
#new ⇒ Object
GET /tokens/new
9 10 |
# File 'app/controllers/notee/tokens_controller.rb', line 9 def new end |