-
Notifications
You must be signed in to change notification settings - Fork 443
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
Migrate ViewComponent::Base.format to return a format instead of the variant #1973
Comments
This makes absolute sense to me, let's do it. /cc @jcoyne |
👋 Hello, author of rails/rails#50623 here. In that PR's current state, I don't think there's any change to the significance of the |
@seanpdoyle 👋 thanks for commenting here too and sharing context! I imagine we still want to make this change since the current behavior isn't exactly correct, and we'll get some benefits from implementing it. Right now I don't think |
@BlakeWilliams @seanpdoyle I believe the request.format method is a more reliable way to get the format. It doesn't Make much sense to me to use a json format for example in an html request |
This is related to the HTML escaping conversations, but we should use the
format
method to correctly indicate the type of content that the component is generating, especially since that may be utilized by rails/rails#50623.This is likely a breaking change, but I propose that we:
.html.erb
, JSON for.jbuilder
, etc.format
as being overridable when necessarycall
method without also implementingformat
, warn that we will default to HTML and escape.The text was updated successfully, but these errors were encountered: