amberframework/jasper-helpers

Rename `text_area` to `textarea_field`

Opened this issue · 6 comments

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?

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?

@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?

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

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">

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.

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