Class: Admin::PartialBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Admin::PartialBuilder
show all
- Defined in:
- lib/ecrire/app/forms/admin/partial_builder.rb
Defined Under Namespace
Classes: Options
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
73
74
75
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 73
def method_missing(method, *args, &block)
@template.send(method, *args, &block)
end
|
Instance Method Details
#editor ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 23
def editor
[
editor_options,
content_tag(:div, class: %w(main editor)) do
[
editor_content,
content_tag(:div, preview, id: "editorSideContent")
].join.html_safe
end
].join.html_safe
end
|
#errors ⇒ Object
4
5
6
7
8
9
10
11
12
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 4
def errors
return unless object.errors.any?
content_tag :div, class: %w(container errors) do
[
content_tag(:span, h(object.errors.full_messages.to_sentence)),
link_to("x", "javascript:void(0)", class: %w(dismiss button))
].join.html_safe
end
end
|
#title ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 14
def title
content_tag :div, id: "partial_title_wrapper", class: %w(title wrapper) do
[
text_field(:title, placeholder: t('.title'), class: %w(input)),
possible_actions
].join.html_safe
end
end
|