Sha256: 2cb25c6ea6963f4719693ee7c188470b1b10b3a12eaa83147e424421e9641935

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

module Dorsale
  module FormHelper
    def form_buttons(opts = {})
     back_url = opts[:back_url]
     back_url = url_for(:back).html_safe if back_url.nil?

      content_tag("div", class: "actions cdiv") do
        submit = tag("input", type: "submit", class: "btn btn-success btn-sm", value: "Valider", id: "submit")
        cancel = content_tag("a", href: back_url, class: "btn btn-primary btn-sm"){ "Annuler" }
        cancel = "" if back_url == false
        submit + cancel
      end
    end

    def horizontal_form_for(obj, opts={}, &block)
      opts = {
        :wrapper => "horizontal_form",
        :html => {
          :class => "form-horizontal"
        }
      }.deep_merge(opts)

      simple_form_for(obj, opts, &block)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dorsale-1.1.4 app/helpers/dorsale/form_helper.rb
dorsale-1.1.3 app/helpers/dorsale/form_helper.rb
dorsale-1.1.2 app/helpers/dorsale/form_helper.rb
dorsale-1.1.1 app/helpers/dorsale/form_helper.rb
dorsale-1.1.0 app/helpers/dorsale/form_helper.rb