module Showbuilder

Public Instance Methods

show_alerts() click to toggle source
# File lib/showbuilder.rb, line 39
def show_alerts
  self.html_contents do |contents|
    self.flash.each do |name, message|
      contents << self.contents_tag(:div, :class => 'alert-message error') do |contents|
        contents << self.content_tag(:a, "x", :href => '#', :class => 'close')
        contents << self.content_tag(:p, message)
      end
    end
  end
end
show_current_itext_base() click to toggle source
# File lib/showbuilder.rb, line 50
def show_current_itext_base
  self.controller_name.to_s.singularize
end
show_form_button(text_id = nil, options = {}) click to toggle source
# File lib/showbuilder.rb, line 20
def show_form_button(text_id = nil, options = {})
  text_id                        ||= 'save'
  text                           = show_itext("form_button.#{text_id}")
  text_loading                   = show_itext("form_button.#{text_id}_loading")
  options                        ||= {}
  options[:class]                = "form-button btn #{options[:class]}"
  options[:'data-loading-text']  ||= text_loading
  options[:type]                 ||= :submit
  self.content_tag(:button, text, options)
end
show_page_title() click to toggle source
# File lib/showbuilder.rb, line 31
def show_page_title
  self.content_tag :div, :class => 'page-header' do
    self.content_tag :h1 do
      self.show_current_itext("title_#{self.action_name}")
    end
  end
end
show_paginate_renderer() click to toggle source
# File lib/showbuilder.rb, line 16
def show_paginate_renderer
  Showbuilder::ShowPaginateRenderer
end