-
Notifications
You must be signed in to change notification settings - Fork 17
Rails Kit
Markie Arnold edited this page Jun 24, 2019
·
28 revisions
For a rails kit, the wrapping element of the kit should look like the following:
<%= content_tag(:div,
id: object.id,
data: object.data,
class: object.classname("pb_my_kit")) do %>
CONTENT HERE
<% end %>
This allows for every kit to have the following props by default:
- id
- classname
- data
The user should be able to add their own unique id attribute to your kit.
<%= pb_rails("my_kit", props: { id: "awesome_id" }) %>
This is generate in the browser:
<div class="pb_my_kit" id="awesome_id"></div>
The user should be able to add their own classes to your kit, but not override the classes required by the kit.
<%= pb_rails("my_kit", props: { classname: "new_class" }) %>
This is generate in the browser:
<div class="pb_my_kit new_class"></div>