Sha256: d0c60cda94e8f8523cc1c3e0b5b2818329accb372c45b9e036afef003944fc74
Contents?: true
Size: 491 Bytes
Versions: 24
Compression:
Stored size: 491 Bytes
Contents
class SongsController < ApplicationController def index @songs = Song.published.all respond_to do |format| format.json { render json: @songs } end end def shuffled @songs = Song.published.all.shuffle respond_to do |format| format.json { render json: @songs } end end def player @shuffled = params[:shuffled] || false @songs_api = @shuffled ? shuffled_songs_path(:json) : songs_path(:json) render layout: false end end
Version data entries
24 entries across 24 versions & 2 rubygems