ljones140/StieglitzGram

View on GitHub
app/controllers/likes_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class LikesController < ApplicationController

  before_action :authenticate_user!

  def create
    @photo = Photo.find(params[:photo_id])
    @photo.likes.create_with_user(current_user)
    render json: { new_like_count: @photo.likes.count }
  end

end