Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Start writing app/controllers/sessions_controller.rb
class Api::SessionsController < ApplicationController
private
def build_resource
@session = Session.new resource_params
end
def resource
@session ||= Session.new user: current_user
end
def resource_params
params.require(:session).permit(:email, :password)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment