Sha256: a0067c981f8d6736b4c6e3c9868941ddfa83045e57bd770726fe74c61e9dfb06

Contents?: true

Size: 839 Bytes

Versions: 3

Compression:

Stored size: 839 Bytes

Contents

require_dependency "publish_my_data/application_controller"

module PublishMyData
  class ThemesController < ApplicationController

    caches_action :show, :index,
      :cache_path => Proc.new { |c| c.params }, :if => Proc.new { |c| c.request.format.html? }

    respond_to :html, :ttl, :rdf, :nt, :json

    def index
      # don't bother paginating this for now - there probably wont be that many themes
      @themes = Theme.all.resources
      respond_with(@themes)
    end

    def show
      @theme = Theme.by_slug(params[:id])

      if @theme
        @pagination_params = ResourcePaginationParams.from_request(request)
        @datasets = Paginator.new(@theme.datasets_criteria, @pagination_params).paginate
        respond_with(@datasets)
      else
        raise Tripod::Errors::ResourceNotFound
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
publish_my_data-0.0.13 app/controllers/publish_my_data/themes_controller.rb
publish_my_data-0.0.12 app/controllers/publish_my_data/themes_controller.rb
publish_my_data-0.0.11 app/controllers/publish_my_data/themes_controller.rb