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

Introduce suspenders:views generator #1154

Merged

Conversation

stevepolitodesign
Copy link
Contributor

Configures flash messages, page titles via the title gem, and sets the
document lang.

It should be noted that running rails gscaffold generates views that
contain the flash. Although we could have overridden this generator, that
would risk drift between our overridden generator and the one in Rails core.

Additionally, we decided to remove the FlashesHelper introduced in
6c562b95e2e3c7ea31a04e6ef71c6a44b0b9ab2f since that is not a pattern we
currently use.

@stevepolitodesign stevepolitodesign changed the base branch from main to suspenders-3-0-0 January 4, 2024 20:39
@stevepolitodesign stevepolitodesign mentioned this pull request Jan 4, 2024
17 tasks
@stevepolitodesign stevepolitodesign marked this pull request as ready for review January 4, 2024 20:42
Configures flash messages, page titles via the [title][] gem, and sets
the document [lang][].

[title]: https://github.com/calebhearth/title
[lang]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang

It should be noted that running `rails gscaffold` generates [views][]
that contain the flash. Although we could have [overridden][] this
generator, that would risk drift between our overridden generator and
the one in Rails core.

Additionally, we decided to remove the `FlashesHelper` introduced in
[6c562b9][] since that is not a pattern
we currently use.

[views]: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt
[overridden]: https://guides.rubyonrails.org/generators.html#overriding-rails-generator-templates
[6c562b9]: 6c562b9
Copy link
Contributor Author

@stevepolitodesign stevepolitodesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still want to encourage the use over CSS and JavaScript overrides?

<%%= render "javascript" %>
<%%= render "css_overrides" %>

It looks like the CSS overrides is for tests, and the JavaScript is an artifact from 36ec034.

I originally thought these were for creating one-off changes via content_for, but they're actually rendering a partial. Because of this, I think we're safe to remove them.

@stevepolitodesign stevepolitodesign merged commit 51dcd4b into suspenders-3-0-0 Jan 10, 2024
2 checks passed
@stevepolitodesign stevepolitodesign deleted the suspenders-3-0-0-views-generator branch January 10, 2024 12:31
stevepolitodesign added a commit that referenced this pull request May 10, 2024
Configures flash messages, page titles via the [title][] gem, and sets
the document [lang][].

[title]: https://github.com/calebhearth/title
[lang]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang

It should be noted that running `rails gscaffold` generates [views][]
that contain the flash. Although we could have [overridden][] this
generator, that would risk drift between our overridden generator and
the one in Rails core.

Additionally, we decided to remove the `FlashesHelper` introduced in
[6c562b9][] since that is not a pattern
we currently use.

[views]: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt
[overridden]: https://guides.rubyonrails.org/generators.html#overriding-rails-generator-templates
[6c562b9]: 6c562b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant