Sha256: b6f483edace2956cded8e71e06f698b4940b214398ce136d00d01fba4d0b43f1

Contents?: true

Size: 647 Bytes

Versions: 19

Compression:

Stored size: 647 Bytes

Contents

module Riveter
  module EnquiryFormHelper
    def enquiry_form_for(enquiry, options={}, &block)
      enquiry_class_name = enquiry.class.name.underscore
      options = {
        :as => enquiry_class_name.gsub(/_enquiry$/, ''),
        :url => enquiry_class_name.gsub(/_enquiry$/, ''),
        :method => :get
      }.merge(options)

      respond_to?(:simple_form_for) ?
        simple_form_for(enquiry.query_filter, options, &block) :
        form_for(enquiry.query_filter, options, &block)
    end

    def paginate_enquiry(enquiry, options={}, &block)
      paginate(enquiry.query, options, &block) if respond_to?(:paginate)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
riveter-0.8.3 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.8.2 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.8.1 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.8.0 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.7.0 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.6.0 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.3.0 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.2.1 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.2.0 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.1.1 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.15 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.14 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.13 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.12 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.11 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.10 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.9 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.8 app/helpers/riveter/enquiry_form_helper.rb
riveter-0.0.7 app/helpers/riveter/enquiry_form_helper.rb