Sha256: f734b8aa2b56b6687c3565410a12c69f2e06fef17679b2df9951f5f5d9706d50

Contents?: true

Size: 667 Bytes

Versions: 19

Compression:

Stored size: 667 Bytes

Contents

require 'showcase'

module Admino
  module Query
    class BasePresenter < Showcase::Presenter
      presents_collection :filter_groups
      presents :sorting

      def form(options = {}, &block)
        h.form_for(
          self,
          options.reverse_merge(default_form_options),
          &block
        )
      end

      def simple_form(options = {}, &block)
        h.simple_form_for(
          self,
          options.reverse_merge(default_form_options),
          &block
        )
      end

      def default_form_options
        {
          as: :query,
          method: :get,
          url: h.request.fullpath
        }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
admino-0.0.22 lib/admino/query/base_presenter.rb
admino-0.0.21 lib/admino/query/base_presenter.rb
admino-0.0.20 lib/admino/query/base_presenter.rb
admino-0.0.19 lib/admino/query/base_presenter.rb
admino-0.0.18 lib/admino/query/base_presenter.rb
admino-0.0.17 lib/admino/query/base_presenter.rb
admino-0.0.16 lib/admino/query/base_presenter.rb
admino-0.0.15 lib/admino/query/base_presenter.rb
admino-0.0.14 lib/admino/query/base_presenter.rb
admino-0.0.13 lib/admino/query/base_presenter.rb
admino-0.0.12 lib/admino/query/base_presenter.rb
admino-0.0.11 lib/admino/query/base_presenter.rb
admino-0.0.10 lib/admino/query/base_presenter.rb
admino-0.0.9 lib/admino/query/base_presenter.rb
admino-0.0.8 lib/admino/query/base_presenter.rb
admino-0.0.7 lib/admino/query/base_presenter.rb
admino-0.0.6 lib/admino/query/base_presenter.rb
admino-0.0.5 lib/admino/query/base_presenter.rb
admino-0.0.4 lib/admino/query/base_presenter.rb