c a n d l a n d . n e t

Subcomponent

Dusty Candland | | opensource, ruby, rails, erb

Components are stored in app/views/components and are named _component.html.erb. They can also be stored in a subdirectory of app/views/components and are named using the component name for the directory and the partial component/_component.html.erb.

Additional subcomponent partials can be included in the component directory allowing to break up the component into smaller pieces.

Button component:

<button>
<%= this.text %>
</button>

Usage:

<%= component :button, text: 'Click Me' %>

More deailts in the readme: Subcomponent

Webmentions

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site: