Sha256: 4326e685f8a8d433a4f605b3cf432260b968fd0d442b3c297dc4286f62fabd34

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

require 'rexml/document'

# rdoc-image:images/moderngeosystems_logo.png
module BulmaFormRails

  # rdoc-image:../images/moderngeosystems_logo.png
  # 
  # This Ruby on Rails Helper module allows easy and efficient web form construction with labeled fields of different types.
  # It also supports tabular editable multi-object subforms. 
  module HeaderAndFooterHelpers
    
    # Render the header for a standard index page.  Automatically calls +bulma_message_box+.
    # * +name+ - a symbol representing the model name
    # * +models_path+ - the controller URL path for the action that renders the model collection
    def bulma_index_header(name, models_path)
      render partial: 'bulma_form_rails/index_header', locals: {name: name, models_path: models_path}
    end
  
    # Render a standard model form page footer.
    # * +form+ - the form object
    # * +models_path+ - the controller URL path for the action that renders the model collection
    # * +options+ - a hash of additional options:
    #   * +exclude_submit_button+ - don't include a submit button if true
    # * +block+ - optional ERb to render any additional content for the footer, such as additional buttons
    def bulma_form_footer(form, models_path, options = {}, &block)
      if block_given?
        render layout: 'bulma_form_rails/form_footer', locals: {form: form, url: models_path, options: options}, &block
      else
        render partial: 'bulma_form_rails/form_footer', locals: {form: form, url: models_path, options: options}
      end 
      
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bulma_form_rails-0.9.1 lib/bulma_form_rails/header_and_footer_helpers.rb