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

Add helper for generating a label only #480

Open
frankieroberto opened this issue Feb 22, 2024 · 0 comments
Open

Add helper for generating a label only #480

frankieroberto opened this issue Feb 22, 2024 · 0 comments

Comments

@frankieroberto
Copy link
Collaborator

Usually a label is generated as part of the helper for the text input, as both the label and the input get wrapped in a "form group" container, which then gets a red border on the left when there’s an error present.

However there might be some rare occasions where it's best to generate the label separately, for example if the labels and inputs are within a table.

This would allow us to support this:

<tr>
  <th><%= f.govuk_label :price, "Price" %></th>
  <td><%= f.govuk_text_field :price, label: nil %></td>
</tr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant