Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API documentation and revert unnecessary change in preview.rb #1827

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Fix API documentation and revert unnecessary change in `preview.rb`.

*Richard Macklin*

* Initialize ViewComponent::Config with defaults before framework load.

*Simon Fish*
Expand Down
12 changes: 7 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ nav_order: 3

Returns the current config.

### `.config=(value)`

Replaces the entire config. You shouldn't need to use this directly
unless you're building a `ViewComponent::Config` elsewhere.

### `.sidecar_files(extensions)`

Find sidecar files for the given extensions.
Expand Down Expand Up @@ -160,6 +155,13 @@ Defaults to `nil`. If this is falsy, generators will use

Returns the value of attribute config.

### `#current`

Returns the current ViewComponent::Config. This is persisted against this
class so that config options remain accessible before the rest of
ViewComponent has loaded. Defaults to an instance of ViewComponent::Config
with all other documented defaults set.

### `.default_preview_layout`

A custom default layout used for the previews index page and individual
Expand Down
2 changes: 1 addition & 1 deletion lib/view_component/preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module ViewComponent # :nodoc:
class Preview
include Rails.application.routes.url_helpers if defined?(Rails) && Rails.application.present?
include Rails.application.routes.url_helpers if defined?(Rails.application.routes.url_helpers)
camertron marked this conversation as resolved.
Show resolved Hide resolved
include ActionView::Helpers::TagHelper
include ActionView::Helpers::AssetTagHelper
extend ActiveSupport::DescendantsTracker
Expand Down
Loading