Module: Fluxbit::ComponentsHelper
- Defined in:
- app/helpers/fluxbit/components_helper.rb
Instance Method Summary collapse
- #fluxbit_method(method_name, *args, **kwargs, &c) ⇒ Object
- #form_builder ⇒ Object
-
#fx_heading ⇒ Object
Typography.
- #fx_txt ⇒ Object
Instance Method Details
#fluxbit_method(method_name, *args, **kwargs, &c) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'app/helpers/fluxbit/components_helper.rb', line 37 def fluxbit_method(method_name, *args, **kwargs, &c) component_klass = "Fluxbit::#{method_name}Component".constantize if kwargs[:with_content] content = kwargs.delete(:with_content) render(component_klass.new(*args, **kwargs).with_content(content), &c) else render(component_klass.new(*args, **kwargs), &c) end end |
#form_builder ⇒ Object
20 |
# File 'app/helpers/fluxbit/components_helper.rb', line 20 def form_builder(...) = fluxbit_method("Form::FormBuilder", ...) |
#fx_heading ⇒ Object
Typography
34 |
# File 'app/helpers/fluxbit/components_helper.rb', line 34 def fx_heading(...) = fluxbit_method("Heading", ...) |
#fx_txt ⇒ Object
35 |
# File 'app/helpers/fluxbit/components_helper.rb', line 35 def fx_txt(...) = fluxbit_method("Text", ...) |