Module: Fluxbit::ComponentsHelper

Defined in:
app/helpers/fluxbit/components_helper.rb

Instance Method Summary collapse

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_builderObject



20
# File 'app/helpers/fluxbit/components_helper.rb', line 20

def form_builder(...) = fluxbit_method("Form::FormBuilder", ...)

#fx_headingObject

Typography



34
# File 'app/helpers/fluxbit/components_helper.rb', line 34

def fx_heading(...) = fluxbit_method("Heading", ...)

#fx_txtObject



35
# File 'app/helpers/fluxbit/components_helper.rb', line 35

def fx_txt(...) = fluxbit_method("Text", ...)