Skip to content

Commit 0282749

Browse files
committed
add slim component
1 parent 59603a8 commit 0282749

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ gem "uglifier", ">= 1.3.0"
1616
# See https://github.com/rails/execjs#readme for more supported runtimes
1717
# gem 'mini_racer', platforms: :ruby
1818
gem "octicons_helper"
19+
gem "slim"
1920

2021
gem "view_component"
2122

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ GEM
235235
sprockets-rails
236236
tilt
237237
securerandom (0.4.1)
238+
slim (5.2.1)
239+
temple (~> 0.10.0)
240+
tilt (>= 2.1.0)
238241
sprockets (4.2.2)
239242
concurrent-ruby (~> 1.0)
240243
logger
@@ -244,6 +247,7 @@ GEM
244247
activesupport (>= 6.1)
245248
sprockets (>= 3.0.0)
246249
stringio (3.1.7)
250+
temple (0.10.3)
247251
thor (1.4.0)
248252
tilt (2.6.1)
249253
timeout (0.4.3)
@@ -284,6 +288,7 @@ DEPENDENCIES
284288
puma (~> 4.3)
285289
rails (~> 8)
286290
sassc-rails
291+
slim
287292
tzinfo-data
288293
uglifier (>= 1.3.0)
289294
view_component
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1 Hi!

app/components/slim_component.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class SlimComponent < ViewComponent::Base
2+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require "test_helper"
2+
3+
class SlimComponentTest < ViewComponent::TestCase
4+
def test_inline_template
5+
render_inline(SlimComponent.new)
6+
7+
assert_text("Hi!")
8+
end
9+
end

0 commit comments

Comments
 (0)