Sha256: 072140ccea57cd73cb292337cc64ab1e24f838aa56363ca324591ff0cd40da66

Contents?: true

Size: 560 Bytes

Versions: 10

Compression:

Stored size: 560 Bytes

Contents

module PublishMyData
  class ThemeRenderParams

    def initialize(resource)
      @resource = resource
      @theme = resource.as_theme
    end

    # e.g. opts[:pagination_params] => ResourcePaginationParams.new
    def render_params(opts)
      datasets = Paginator.new(@theme.datasets_criteria, opts[:pagination_params]).paginate
      {
         template: 'publish_my_data/themes/show',
         locals: {
           theme: @theme,
           datasets: datasets,
           pagination_params: opts[:pagination_params]
         }
      }
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
publish_my_data-0.0.20 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.19 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.18 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.17 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.16 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.15 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.14 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.13 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.12 lib/publish_my_data/render_params/theme_render_params.rb
publish_my_data-0.0.11 lib/publish_my_data/render_params/theme_render_params.rb