Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 28, 2019 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryKuz/d7e27c3661a137e24e60afe6901ab1da to your computer and use it in GitHub Desktop.
Save MaryKuz/d7e27c3661a137e24e60afe6901ab1da to your computer and use it in GitHub Desktop.
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