Sha256: 8cf293620727d642f59ac114ed43c14cc45c26b87fc66504adb7dfb57c1dcca5

Contents?: true

Size: 722 Bytes

Versions: 3

Compression:

Stored size: 722 Bytes

Contents

module Elabs
  class AlbumsController < ContentApplicationController
    ALLOWED_NESTED_FROM = %w[language license tag user project].freeze
    ALLOWED_ORDER_FROM  = %w[name published_at updated_at].freeze

    before_action :set_album, only: %i[show]

    # GET /albums
    # GET /albums.json
    def index
      @albums = scope_request(Album.published).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
    end

    # GET /albums/1
    # GET /albums/1.json
    def show; end

    private

    # Use callbacks to share common setup or constraints between actions.
    def set_album
      @album         = Album.find_publicly_visible(params[:id])
      @album_uploads = @album.uploads.for_relation
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elabs-3.0.0 app/controllers/elabs/albums_controller.rb
elabs-2.0.0 app/controllers/elabs/albums_controller.rb
elabs-2.0.0.pre app/controllers/elabs/albums_controller.rb