Last active
May 13, 2024 16:40
-
-
Save dgorodnichy/d0ed48a3754925e7846479807fbb1054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module SqlView | |
class FilmsController < ApplicationController | |
def index | |
render json: find_films | |
end | |
private | |
def find_films | |
FilmRating | |
.select(:title, :genre, :rate) | |
.as_json(except: :id) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment