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

content_tagをtagにできるかも(?) #159

Open
lef237 opened this issue Nov 29, 2024 · 0 comments
Open

content_tagをtagにできるかも(?) #159

lef237 opened this issue Nov 29, 2024 · 0 comments

Comments

@lef237
Copy link
Owner

lef237 commented Nov 29, 2024

概要

tagを使いたい。

背景

Rails: 5.1以降のtagヘルパー記法はcontent_tagより便利|TechRacho by BPS株式会社

例示

Before

= content_tag :div, nil, id: "guestcoquotebutton#{index}", data: { quoteId: quote.id, numberCoquoted: number_coquoted }.to_json, class: 'mt-2'

After

= tag.div id: "guestcoquotebutton#{index}", data: { quoteId: quote.id, numberCoquoted: number_coquoted }.to_json, class: 'mt-2'

こんなふうにできるはず

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