Class: Lookbook::AppController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Lookbook::AppController
- Defined in:
- app/controllers/lookbook/app_controller.rb
Constant Summary collapse
- EXCEPTIONS =
[ViewComponent::PreviewTemplateError, ViewComponent::ComponentError, ViewComponent::TemplateError, ActionView::Template::Error]
Instance Method Summary collapse
Instance Method Details
#preview ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/controllers/lookbook/app_controller.rb', line 18 def preview if @example render html: rendered_example else render "app/not_found" end end |
#show ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/lookbook/app_controller.rb', line 26 def show if @example begin @rendered_example = rendered_example.gsub("\"", """) (@example.type == :group ? @example.examples : [@example]).each do |example| include_example_data(example) end assign_inspector rescue *EXCEPTIONS render "app/error" end else render "app/not_found" end end |