Sha256: 0fbd42b04f3da80ad1f4d50d0dab0559c0f2b0af42a374695fffebbdf405fbd0

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

require 'rexml/document'

module BulmaFormRails

  # rdoc-image:https://github.com/modgeosys/bulma_form_rails/blob/371b651b4cf38336f85378467f15b98b5367049e/doc/images/modgeosys_logo.jpg?raw=true
  # 
  # https://kevinweller.name
  # 
  # This Ruby on Rails Helper module allows easy and efficient index and form page header and footer rendering.
  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-1.0.4 lib/bulma_form_rails/header_and_footer_helpers.rb