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

Separation of inputs into separate more maintainable files #518

Merged
merged 7 commits into from
Feb 18, 2019

Conversation

simmerz
Copy link
Contributor

@simmerz simmerz commented Feb 8, 2019

@lcreid this is how I propose to tackle #517 .

I'd like to get this done across all the fields and then figure out if we can DRY any of it up, but perhaps that's a second exercise.

What are your thoughts?

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 the PR. I have a couple of questions in comments in the PR. It's a good PR, because you're pointing me to what you're thinking, and you're making me think more about what you should be trying to achieve. I'll try to think about this a bit more this weekend. Feel free to answer the questions and further develop the PR if you wish.

P.S. I'm using the "Review" mechanism of GitHub, but please take my comments in the spirit of a conversation, rather than a review.

Thanks again for your contributions!

@simmerz
Copy link
Contributor Author

simmerz commented Feb 14, 2019

@lcreid This has now been updated against latest master

I've taken the liberty of removing the method_alias_chain "clone" file as it can be done more simply as I've demonstrated in this.

I've deliberately not refactored the various field inputs into smaller ones as I think that is a separate job.

@simmerz simmerz changed the title WIP: TextField example separation Separation of inputs into separate more maintainable files Feb 14, 2019
@simmerz simmerz force-pushed the maintainable_fields branch from 5e9a603 to e614081 Compare February 14, 2019 13:44
@lcreid
Copy link
Contributor

lcreid commented Feb 15, 2019

I like what I see. There's a lot of work here, and you obviously have a good grasp of loading, requiring, etc. I've wondered myself whether there were better ways to do things with the new Ruby and Rails that we're supporting nowadays. I also like how you cleaned up the redundancy around the methods that are similar.

Still, I'd like to take a longer look at it (sorry for the delay already, but paid work has to come first, I'm afraid).

In the meantime, I've realized that we didn't have any tests to test for the "_without_bootstrap" methods. Since you've changed the implementation of that, it would be worthwhile to add at least one test of a "_without_bootstrap" method, if for no other reason, than to record that it's a requirement. E.g.

test "text fields are wrapped correctly" do
  expected = <<-HTML.strip_heredoc
    <input id="user_email" name="user[email]" type="text" value="steve@example.com" />
  HTML
  assert_equivalent_xml expected, @builder.text_field_without_bootstrap(:email)
end

That may not be exactly right, but should give you the idea of what I'm suggesting.

Thanks again. Great work!

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 the PR! This is great work! Overall I think it's going to be a lot easier to maintain bootstrap_form with this. I'm looking forward to not having to scroll up and down so much :-).

I made a few comments, but they're really questions to satisfy my curiosity.

Thanks again for the good work!

@simmerz
Copy link
Contributor Author

simmerz commented Feb 18, 2019

In the meantime, I've realized that we didn't have any tests to test for the "_without_bootstrap" methods. Since you've changed the implementation of that, it would be worthwhile to add at least one test of a "_without_bootstrap" method, if for no other reason, than to record that it's a requirement. E.g.

Added a test just like this

@lcreid lcreid merged commit 3a825cf into bootstrap-ruby:master Feb 18, 2019
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.

2 participants