Skip to content

Commit a6a4f01

Browse files
author
Nicholas Barone
committed
Shim for rendering partials
1 parent 58f9dd2 commit a6a4f01

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/storybook.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require "storybook/version"
22
require "storybook/preview"
3+
require "storybook/partial_preview_component"
34
require "storybook/railtie" if defined?(Rails::Railtie)
45

56
module Storybook; end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'view_component'
2+
3+
module Storybook
4+
class PartialPreviewComponent < ViewComponent::Base
5+
slim_template <<~SLIM
6+
= render partial: @partial
7+
SLIM
8+
9+
def initialize(partial:)
10+
@partial = partial
11+
end
12+
end
13+
end

0 commit comments

Comments
 (0)