Module: Showbuilder

Includes:
Corekit, I18nText, ShowForm, ShowModelForm, ShowModelTable, ShowModelView
Defined in:
lib/showbuilder.rb,
lib/showbuilder/corekit.rb,
lib/showbuilder/i18n_text.rb,
lib/showbuilder/show_form.rb,
lib/showbuilder/show_model_form.rb,
lib/showbuilder/show_model_view.rb,
lib/showbuilder/sequence_manager.rb,
lib/showbuilder/show_model_table.rb,
lib/showbuilder/builders/form_builder.rb,
lib/showbuilder/show_paginate_renderer.rb,
lib/showbuilder/builders/template_methods.rb,
lib/showbuilder/builders/model_form_builder.rb,
lib/showbuilder/builders/model_view_builder.rb,
lib/showbuilder/builders/model_table_row_builder.rb

Defined Under Namespace

Modules: Builders, Corekit, I18nText, ShowForm, ShowModelForm, ShowModelTable, ShowModelView Classes: SequenceManager, ShowPaginateRenderer

Instance Method Summary collapse

Methods included from ShowForm

#show_form

Methods included from ShowModelTable

#get_show_model_table_column_count, #show_model_table, #show_model_table_body, #show_model_table_body_row, #show_model_table_header, #show_model_table_header_row, #show_model_table_no_record_row

Methods included from ShowModelForm

#model_error_messages, #show_model_form

Methods included from ShowModelView

#show_model_view

Methods included from I18nText

#show_current_itext, #show_itext

Methods included from Corekit

#call_object_methods, #contents_tag, #currency_string, #date_string, #divc, #html_contents, #merge_class_option, #percent_string, #safe_html_string, #time_string

Instance Method Details

#show_alertsObject



39
40
41
42
43
44
45
46
47
48
# 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.(:a, "x", :href => '#', :class => 'close')
        contents << self.(:p, message)
      end
    end
  end
end

#show_current_itext_baseObject



50
51
52
# 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 = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# 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.(:button, text, options)
end


54
55
56
# File 'lib/showbuilder.rb', line 54

def show_model_link_to(name, options)
  self.link_to name, options
end

#show_page_titleObject



31
32
33
34
35
36
37
# File 'lib/showbuilder.rb', line 31

def show_page_title
  self. :div, :class => 'page-header' do
    self. :h1 do
      self.show_current_itext("title_#{self.action_name}")
    end
  end
end

#show_paginate_rendererObject



16
17
18
# File 'lib/showbuilder.rb', line 16

def show_paginate_renderer
  Showbuilder::ShowPaginateRenderer
end