layout | title | nav_order | permalink |
---|---|---|---|
default |
Home |
1 |
/ |
A simple server-side component library which seamlessly hooks into your Rails project and allows you to create simple backend components. They work like mini controllers which are bound with their view.
Created by [Garbus Beach]({{ site.data.amber_component.garbus_beach_url }}){:target="_blank"} and [Mateusz Drewniak]({{ site.data.amber_component.mateusz_drewniak_url }}){:target="_blank"}.
class UserComponent < AmberComponent::Base
before_render do
@user = User.new(
name: @name,
email: @email,
balance: @balance
)
end
end
<div class="card">
Name: <%= @user.name %>
Email: <%= @user.email %>
Balance: <%= @user.balance %>
</div>
<%= user_component name: 'John', email: '[email protected]', balance: 12.00 %>
psst! - Haml, Markdown and Slim are also supported!
Get started now{: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } View it on GitHub{: .btn .fs-5 .mb-4 .mb-md-0 target="_blank"}