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

Version Path
mix-rails-0.26.3 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.26.3 app/controllers/songs_controller.rb
mix-rails-0.26.2 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.26.2 app/controllers/songs_controller.rb
mix-rails-0.26.1 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.26.1 app/controllers/songs_controller.rb
mix-rails-0.26.0 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.26.0 app/controllers/songs_controller.rb
mix-rails-0.25.1 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.25.1 app/controllers/songs_controller.rb
mix-rails-0.25.0 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.25.0 app/controllers/songs_controller.rb
mix-rails-0.24.1 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.24.1 app/controllers/songs_controller.rb
mix-rails-0.24.0 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.24.0 app/controllers/songs_controller.rb
mix-rails-0.23.1 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.23.1 app/controllers/songs_controller.rb
mix-rails-0.23.0 mix-rails-songs/app/controllers/songs_controller.rb
mix-rails-songs-0.23.0 app/controllers/songs_controller.rb