Class: ScaffoldMarkup::Builders::PageBuilder
Instance Attribute Summary
Attributes inherited from BaseBuilder
#block, #template, #url
Instance Method Summary
collapse
#table, #table_actions, #table_body, #table_head
#link_button
Methods inherited from BaseBuilder
#html_safe, #initialize
Instance Method Details
#container(&block) ⇒ Object
13
14
15
16
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 13
def container(&block)
Tag.new(:div, template.capture(self, &block), :class => 'container').html_safe
end
|
#flash_messages ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 42
def flash_messages
unless template.content_for?(:flash)
template.flash.keys.each do |key|
if template.flash[key].is_a? Array
flash_text = template.flash[key].join('<br>')
else
flash_text = template.flash[key]
end
template.content_for(:flash, self.send("alert_#{key}", flash_text))
end
end
end
|
34
35
36
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 34
def form_for(model, &block)
FormBuilder.new(template, model, &block).html_safe
end
|
22
23
24
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 22
def (title, subtitle=nil)
template.content_for(:page_header, PageHeader.new(title, subtitle).html_safe)
end
|
#nav_bar(&block) ⇒ Object
38
39
40
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 38
def nav_bar(&block)
NavBarBuilder.new(template, &block).html_safe
end
|
#submit_primary(*args) ⇒ Object
30
31
32
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 30
def submit_primary(*args)
Submit.primary(*args).html_safe
end
|
#title(text) ⇒ Object
18
19
20
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 18
def title(text)
template.content_for(:page_title, text)
end
|
#to_s ⇒ Object
7
8
9
10
11
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 7
def to_s
html = template.capture(self, &block)
flash_messages
html
end
|
#well_small(&block) ⇒ Object
26
27
28
|
# File 'lib/scaffold_markup/builders/page_builder.rb', line 26
def well_small(&block)
Well.small(template.capture(self, &block)).html_safe
end
|