Class: Admin::PartialBuilder::Options
- Inherits:
-
Object
- Object
- Admin::PartialBuilder::Options
show all
- Defined in:
- lib/ecrire/app/forms/admin/partial_builder.rb
Instance Method Summary
collapse
Constructor Details
#initialize(template) ⇒ Options
Returns a new instance of Options.
79
80
81
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 79
def initialize(template)
@template = template
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
99
100
101
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 99
def method_missing(method, *args, &block)
@template.send(method, *args, &block)
end
|
Instance Method Details
#editor_options ⇒ Object
87
88
89
90
91
92
93
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 87
def editor_options
[
content_tag(:a, t('fields.text'), binding: ".editor.content", class: %w(content active)),
content_tag(:a, t('fields.CSS'), binding: ".editor.stylesheet", class: %w(content)),
content_tag(:a, t('fields.JS'), binding: ".editor.javascript", class: %w(content))
].join.html_safe
end
|
#render ⇒ Object
83
84
85
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 83
def render
content_tag(:div, editor_options, class: %w(editor options))
end
|
#t(*args) ⇒ Object
95
96
97
|
# File 'lib/ecrire/app/forms/admin/partial_builder.rb', line 95
def t(*args)
I18n.t args[0], scope: %w(admin partials form options)
end
|