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

Rename text_area to textarea_field #34

Open
westonganger opened this issue Jan 11, 2019 · 6 comments
Open

Rename text_area to textarea_field #34

westonganger opened this issue Jan 11, 2019 · 6 comments

Comments

@westonganger
Copy link
Contributor

westonganger commented Jan 11, 2019

This one seemed to stick out. It should match all the other *_field methods. I would be happy to make a PR just need the goahead first. If so would we need to retain the legacy method for backwards compatibility?

@robacarp
Copy link
Member

My dream DSL for this would probably be something like this:

- text_field -> <input type="text">
- password_field -> <input type="password">
- hidden_field -> <input type="hidden">
- file_field -> <input type="file">
+ text_input -> <input type="text">
+ password_input -> <input type="password">
+ hidden_input -> <input type="hidden">
+ upload_file -> <input type="file">
 check_box -> <input type="checkbox">
 radio_button -> <input type="radio">
 submit -> <input type="submit">
 select -> <select>
 text_area -> <textarea>

However, I'm not sure it's worth the breaking change this would introduce to micromanage the DSL... @drujensen thoughts?

@drujensen
Copy link
Member

@robacarp I really like that. I would also consider making this a standard naming convention and change the following as well:

+ file_input -> <input type="file">
+ checkbox_input -> <input type="checkbox">
+ radio_input -> <input type="radio">
+ submit_input -> <input type="submit">

wdyt?

@drujensen
Copy link
Member

@westonganger I think text_area is different than the other ones because it's the html tag <text_area> and not an `

@westonganger
Copy link
Contributor Author

Your right the text_area tag makes sense once you change the other to *_input.

@robacarp like your solution. I also prefer @drujensen drujensen additional suggestions.

Another suggestion, after seeing submit_input I would love to see a submit_button helper for <button type="submit">

@robacarp
Copy link
Member

file_input yeah, but my preference wouldn't be to suffix _input everywhere... the dsl context is enough to demonstrate that you're doing inputs (fields, controls, etc).

The reason I tagged text, password, and hidden with_input is because I couldn't think of any other naming scheme.

@eliasjpr
Copy link
Contributor

eliasjpr commented Jan 23, 2019

I personally would like to drop input and field altogether. would make it feel more natural and close to the actual html tags. The only reason I will see the need for the _input or _field is because of name collision, and I am not sure if that would happen

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

No branches or pull requests

4 participants