--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can set the `label_text` option in your configuration, it receives a `required` argument that you can conditionally add a required or optional text to the label, for instance:lambda { |label, required, explicit_label| required.present? ? "#{required} #{label}" : "(optional) #{label}" }Hope that helps.
On Tue, Jul 7, 2015 at 10:13 AM, Adrien <adrien....@gmail.com> wrote:
Hey!I've been looking for a way to put some labels for optional fields. I've spotted how to set and build the label text for required text but I found nothing for optional fields.Any hints?
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simpleform+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--At.
Carlos Antonio
Hi Carlos,
I've got a very similar question, but in my case I would like it to be in a separate element. Would you recon I'd do that in the same fashion, in combination with #html_safe, or is there possibly a better solution?
On Tuesday, July 7, 2015 at 3:35:06 PM UTC+2, Carlos Antonio da Silva wrote:
You can set the `label_text` option in your configuration, it receives a `required` argument that you can conditionally add a required or optional text to the label, for instance:lambda { |label, required, explicit_label| required.present? ? "#{required} #{label}" : "(optional) #{label}" }Hope that helps.
On Tue, Jul 7, 2015 at 10:13 AM, Adrien <adrien....@gmail.com> wrote:
Hey!I've been looking for a way to put some labels for optional fields. I've spotted how to set and build the label text for required text but I found nothing for optional fields.Any hints?
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--At.
Carlos Antonio--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
If you're thinking about adding html to the label_text option so that you can tweak the required output, you may be able to use the html: option available through the locale instead. You can change the entire html for the required flag in there, with a different html as you need.If you need html over your optional flag like the previous option, then I think the html locale option might not work for you, and in this case it's probably ok to use it in the label_text (since you have total control over the output).
On Mon, Apr 11, 2016 at 6:50 AM, Jeroen Visser <m...@jrnv.nl> wrote:
Hi Carlos,
I've got a very similar question, but in my case I would like it to be in a separate element. Would you recon I'd do that in the same fashion, in combination with #html_safe, or is there possibly a better solution?
On Tuesday, July 7, 2015 at 3:35:06 PM UTC+2, Carlos Antonio da Silva wrote:
You can set the `label_text` option in your configuration, it receives a `required` argument that you can conditionally add a required or optional text to the label, for instance:lambda { |label, required, explicit_label| required.present? ? "#{required} #{label}" : "(optional) #{label}" }Hope that helps.
On Tue, Jul 7, 2015 at 10:13 AM, Adrien <adrien....@gmail.com> wrote:
Hey!I've been looking for a way to put some labels for optional fields. I've spotted how to set and build the label text for required text but I found nothing for optional fields.Any hints?
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simpleform+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--At.
Carlos Antonio
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simpleform+unsub...@googlegroups.com.
--At.
Carlos Antonio
Hi Carlos,
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--At.
Carlos Antonio
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
--At.
Carlos Antonio
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "SimpleForm" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plataformatec-simpleform/_NRBranMCWE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.