Module: BulmaFormRails::HeaderAndFooterHelpers
- Defined in:
- lib/bulma_form_rails/header_and_footer_helpers.rb
Overview
This Ruby on Rails Helper module allows easy and efficient index and form page header and footer rendering.
Instance Method Summary collapse
-
#bulma_form_footer(form, models_path, options = {}, &block) ⇒ Object
Render a standard model form page footer.
-
#bulma_index_header(name, models_path) ⇒ Object
Render the header for a standard index page.
Instance Method Details
#bulma_form_footer(form, models_path, options = {}, &block) ⇒ Object
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
25 26 27 28 29 30 31 32 |
# File 'lib/bulma_form_rails/header_and_footer_helpers.rb', line 25 def (form, models_path, = {}, &block) if block_given? render layout: 'bulma_form_rails/form_footer', locals: {form: form, url: models_path, options: }, &block else render partial: 'bulma_form_rails/form_footer', locals: {form: form, url: models_path, options: } end end |
#bulma_index_header(name, models_path) ⇒ Object
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
15 16 17 |
# File 'lib/bulma_form_rails/header_and_footer_helpers.rb', line 15 def bulma_index_header(name, models_path) render partial: 'bulma_form_rails/index_header', locals: {name: name, models_path: models_path} end |