Skip to content

Conversation

@krsyoung
Copy link
Contributor

@krsyoung krsyoung commented Oct 5, 2014

Proposed update that will automatically append an asterix (*) to any label associated with a field bound to a model attribute with a presence validator. This pull is associated with issue #143.

@atipugin
Copy link
Contributor

atipugin commented Oct 9, 2014

Would be nice to merge it:)

@potenza
Copy link
Member

potenza commented Oct 9, 2014

Sorry for the delay guys... I'm mid launch with a new company and that's been taking up all my spare time.

The only concern I have with this is that it's turned on by default. I personally don't like using asterisks in my labels and wouldn't want to have to turn them off on all my projects that already use this. Can you add the ability to toggle it on and off with the default being off?

@creativelycloudy
Copy link

I agree with Stephen re: default being 'off', otherwise I would have to
recode previous projects as well.

On 14-10-09 12:40 PM, Stephen Potenza wrote:

Sorry for the delay guys... I'm mid launch with a new company and
that's been taking up all my spare time.

The only concern I have with this is that it's turned on by default. I
personally don't like using asterisks in my labels and wouldn't want
to have to turn them off on all my projects that already use this. Can
you add the ability to toggle it on and off with the default being off?


Reply to this email directly or view it on GitHub
#150 (comment).

@krsyoung
Copy link
Contributor Author

krsyoung commented Oct 9, 2014

Hey guys! Don't disagree here ... I guess the "best" place to control the on/off right now would be to add a parameter within the form creation?

Those of us who are in love with the * would need to add this parameter to each form definition ... something like:

<%= bootstrap_form_for(@thing, layout: :horizontal, required_field_symbol: '*') do |f| %>

Thoughts?

@krsyoung
Copy link
Contributor Author

Amazing, I already forgot how this worked! So, what the change does is add a "required" class to the label ... it is then up to the user to specify some CSS to do something with it. So for example, if a user adds this then they get nice asterisks:

label.required:after {
content:" *";
}

On the other hand, if a user does nothing then nothing changes assuming they don't have a rule for the "required" CSS class.

I could still add an option to enable / disable the class addition (or maybe specify a custom class) but also not looking to over-engineer if folks are happy with it as-is.

Let me know what you think.

@krsyoung
Copy link
Contributor Author

Last attempt, I retract the previous statement, I did include the CSS into rails_bootstrap_forms. So, new proposal, what if I remove / comment the "required" CSS and then go with what I said in the previous comment?

@krsyoung
Copy link
Contributor Author

Hey @potenza,

First .. hope the launch is going / went well and you are still alive! Second, anything I can do to help move this merge request along?

Thanks!

@potenza
Copy link
Member

potenza commented Nov 4, 2014

@krsyoung Thank you! The launch went surprisingly well so we've been a bit overwhelmed for the last couple of weeks (but that's a good thing). This looks good. Thanks for the PR 👍

potenza added a commit that referenced this pull request Nov 4, 2014
@potenza potenza merged commit 7305528 into bootstrap-ruby:master Nov 4, 2014
potenza added a commit that referenced this pull request Nov 4, 2014
@krsyoung
Copy link
Contributor Author

krsyoung commented Nov 4, 2014

Glad to hear @potenza. Thanks for all you do! Absolutely loving this project.

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

Successfully merging this pull request may close these issues.

4 participants