Sha256: 00ee5aeafb405638b80c7126e348a19167c9f31e852a493b5f7c7c4a2e1c4199

Contents?: true

Size: 780 Bytes

Versions: 3

Compression:

Stored size: 780 Bytes

Contents

module AgilideeCommons
  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

3 entries across 3 versions & 1 rubygems

Version Path
agilidee_commons-1.0.5 app/helpers/agilidee_commons/form_helper.rb
agilidee_commons-1.0.4 app/helpers/agilidee_commons/form_helper.rb
agilidee_commons-1.0.3 app/helpers/agilidee_commons/form_helper.rb