module Lucky::MountComponent
Direct including types
Defined in:
lucky/mount_component.crInstance Method Summary
-
#m(component : Lucky::BaseComponent.class, *args, **named_args) : Nil
Appends the
component
to the view.DEPRECATED Use
#mount
instead. Example: mount(MyComponent, arg1: 123) -
#m(component : Lucky::BaseComponent.class, *args, **named_args, &) : Nil
Appends the
component
to the view.DEPRECATED Use
#mount
instead. Example: mount(MyComponent, arg1: 123) do/end -
#mount(component : Lucky::BaseComponent.class, *args, **named_args) : Nil
Appends the
component
to the view. -
#mount(component : Lucky::BaseComponent.class, *args, **named_args, &) : Nil
Appends the
component
to the view.
Instance Method Detail
Appends the component
to the view.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
m(MyComponent)
m(MyComponent, with_args: 123)
DEPRECATED Use #mount
instead. Example: mount(MyComponent, arg1: 123)
Appends the component
to the view. Takes a block, and yields the
args passed to the component.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
m(MyComponent, name: "Jane") do |name|
text name.upcase
end
DEPRECATED Use #mount
instead. Example: mount(MyComponent, arg1: 123) do/end
Appends the component
to the view.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
mount(MyComponent)
mount(MyComponent, with_args: 123)
Appends the component
to the view. Takes a block, and yields the
args passed to the component.
When Lucky::HTMLPage.settings.render_component_comments
is
set to true
, it will render HTML comments showing where the component
starts and ends.
mount(MyComponent, name: "Jane") do |name|
text name.upcase
end