diff --git a/app/views/layouts/component_preview.html.erb b/app/views/layouts/component_preview.html.erb new file mode 100644 index 000000000..62e17fd15 --- /dev/null +++ b/app/views/layouts/component_preview.html.erb @@ -0,0 +1,15 @@ + + + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + + + + <%= yield %> + + diff --git a/config/application.rb b/config/application.rb index 0f5de89ae..b3d5172fd 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,5 +37,8 @@ class Application < Rails::Application config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}")] config.i18n.load_path += Dir[Rails.root.join("app", "furniture", "**", "locales", "**", "*.{rb,yml}")] + + config.view_component.preview_paths << "#{Rails.root}/spec/components/previews" + config.view_component.default_preview_layout = "component_preview" end end