Skip to content
Permalink
Browse files

Extend ComponentHelper in README examples (#143)

* Extend ComponentHelper in README examples

The generator outputs `extend ComponentHelper` and it seems this is necessary for `property` underneath.

* Add empty line after extend

* Trigger tests on pull_request
  • Loading branch information...
AlecRust authored and Spone committed Sep 18, 2019
1 parent d01208d commit 58b00711ff63ac9bdde892375a88fcb4f8129d67
Showing with 5 additions and 1 deletion.
  1. +1 −1 .github/workflows/test.yml
  2. +4 −0 README.md
@@ -1,6 +1,6 @@
name: Tests

on: [push]
on: [push, pull_request]

jobs:
test:
@@ -181,6 +181,8 @@ Each component comes with a Ruby `module`. You can use it to set properties:
# frontend/components/button/button_component.rb
module ButtonComponent
extend ComponentHelper
property :href, required: true
property :text, default: 'My button'
end
@@ -201,6 +203,8 @@ If your partial becomes too complex and you want to extract logic from it, you m
# frontend/components/button/button_component.rb
module ButtonComponent
extend ComponentHelper
property :href, required: true
property :text, default: 'My button'

0 comments on commit 58b0071

Please sign in to comment.
You can’t perform that action at this time.