Class: User::SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- User::SessionsController
- Defined in:
- app/controllers/lesli_guard/user/sessions_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /user/sessions/1.
-
#index ⇒ Object
GET /user/sessions.
Instance Method Details
#destroy ⇒ Object
DELETE /user/sessions/1
48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/lesli_guard/user/sessions_controller.rb', line 48 def destroy return respond_with_not_found unless @user_session if @user_session.delete current_user.logs.create({title: "close_session",description: "by_user: " + current_user.email}) respond_with_successful else respond_with_error(@user_session.errors..to_sentence) end end |
#index ⇒ Object
GET /user/sessions
38 39 40 41 42 43 44 45 |
# File 'app/controllers/lesli_guard/user/sessions_controller.rb', line 38 def index respond_to do |format| format.html {} format.json do return respond_with_pagination(UserService.new(current_user, query).sessions(session[:user_session_id])) end end end |