Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for BS 4.2 switches #514

Merged
merged 4 commits into from
Feb 18, 2019

Conversation

simmerz
Copy link
Contributor

@simmerz simmerz commented Jan 31, 2019

Add :switch value to :custom option for 4.2 switches

@simmerz simmerz changed the title Add tests for check box fields Add support for BS 4.2 switches Jan 31, 2019
Copy link
Contributor

@lcreid lcreid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution! We really appreciate that you're on top of changes to Bootstrap, and that you help this gem keep up.

Good job with the test coverage!

Please add a line or two in the README.md to show people how to use a switch. There is currently documentation for how to use wrapper_class to render a switch (https://github.com/bootstrap-ruby/bootstrap_form#switches). Please change it to show your syntax.

I appreciate how hard it is to change form_builder.rb without triggering RuboCop offenses, so I'll let your changes to .rubocop_todo.yml go by. :)

Again, thanks for your contribution!

@simmerz
Copy link
Contributor Author

simmerz commented Jan 31, 2019

@lcreid I've updated the documentation to show how to use the new :switch syntax

@simmerz
Copy link
Contributor Author

simmerz commented Feb 18, 2019

@lcreid this PR is now rebased against current master, and I've also refactored the check_box.rb file.

I had a question about double quotes - the .rubocop.yml file enforces double quotes, but the default is single quote unless interpolation is required. Any reason for this particular decision?

@lcreid
Copy link
Contributor

lcreid commented Feb 18, 2019

I had a question about double quotes - the .rubocop.yml file enforces double quotes, but the default is single quote unless interpolation is required. Any reason for this particular decision?

I think the simple answer to your question is that both the previous maintainer and myself prefer double quotes. In my case, I like to use contractions when I write, so defaulting to double quotes for strings means I don't have to change the quotes every time I add or take away a contraction from a string. That said, I recognize that there are down sides to both options, so I hope it's not too much of an inconvenience for you.

@lcreid lcreid merged commit cfbdcee into bootstrap-ruby:master Feb 18, 2019
@lcreid
Copy link
Contributor

lcreid commented Feb 18, 2019

Thanks so much for the PR! I really appreciate it that others are keeping up with changes to Bootstrap.

@simmerz
Copy link
Contributor Author

simmerz commented Feb 18, 2019

@lcreid not at all. And regarding double quotes - no inconvenience at all. Always better to ask and to learn than to just accept the status quo though.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants