module

Motion::MountComponent

Instance methods

m(component_class : Motion::Base.class, *args, **named_args) : Nil

Appends the component to the view.

When Motion::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)
Source
m(component_class : Motion::Base.class, *args, **named_args, &) : Nil

Appends the component to the view. Takes a block, and yields the args passed to the component.

When Motion::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
Source
mount(component_class : Motion::Base.class, *args, **named_args) : Nil

Appends the component to the view.

When Motion::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)
Source
mount(component_class : Motion::Base.class, *args, **named_args, &) : Nil

Appends the component to the view. Takes a block, and yields the args passed to the component.

When Motion::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
Source