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

removes <%= if ruby expression is not on a same line #331

Open
skatkov opened this issue Sep 26, 2023 · 0 comments
Open

removes <%= if ruby expression is not on a same line #331

skatkov opened this issue Sep 26, 2023 · 0 comments

Comments

@skatkov
Copy link

skatkov commented Sep 26, 2023

Good day,

Thanks for a great gem. I've ran into what seems to be a questionable behavior that might be not safe to autocorrect.

We have a following code snippet:

<div>
  <%=
                form.select :group_key, (Array.wrap(@gift_card_offer.group_key) + Rewards::Retailer.pluck(:group_key).uniq).sort,
                {include_blank: true, selected: @gift_card_offer.group_key},
                {"data-admin--groupkey-target": "output"}
            %>
</div>

That turned into

<div>
   form.select :group_key, (Array.wrap(@gift_card_offer.group_key) + Rewards::Retailer.pluck(:group_key).uniq).sort,
                {include_blank: true, selected: @gift_card_offer.group_key},
                {"data-admin--groupkey-target": "output"}
            %>
</div>

as you can see <%= was removed. this is not an issue, if <%= and reuby expression is on same line. But doing such "autocorrection" doesn't seem safe to me?

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

No branches or pull requests

1 participant