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

Add range input helper methods #1276

Closed
postmodern opened this Issue May 3, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@postmodern
Contributor

postmodern commented May 3, 2013

Add input helper methods for generate HTML range inputs:

 <input type="range" name="points" min="1" max="10">
@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero May 16, 2013

Contributor

Thanks for the suggestion @postmodern, it's always good to keep on expanding the helpers. Feel free to send a PR. I think that it could go into padrino-helpers/lib/padrino-helpers/form_helpers.rb and be something like:

      def range_field_tag(name, min, max, options={})
        options.reverse_merge!(:name => name, :min => min, :max => max)
        input_tag(:range, options)
      end

Thoughts?

Contributor

dariocravero commented May 16, 2013

Thanks for the suggestion @postmodern, it's always good to keep on expanding the helpers. Feel free to send a PR. I think that it could go into padrino-helpers/lib/padrino-helpers/form_helpers.rb and be something like:

      def range_field_tag(name, min, max, options={})
        options.reverse_merge!(:name => name, :min => min, :max => max)
        input_tag(:range, options)
      end

Thoughts?

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc May 16, 2013

Member

The HTML range works fine with no min and max. I think it would feel better with

def range_field_tag(name, options={})

and :range => 1..10 or :min => 1, :max => 10 as an option.

Member

ujifgc commented May 16, 2013

The HTML range works fine with no min and max. I think it would feel better with

def range_field_tag(name, options={})

and :range => 1..10 or :min => 1, :max => 10 as an option.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero May 16, 2013

Contributor

Yeah, I know, I just thought that it would make it more explicit. Otherwise
you can always use input_tag :)

Darío

On 15 May 2013 23:05, Igor Bochkariov notifications@github.com wrote:

The HTML range works fine with no min and max. I think it would feel
better with

def range_field_tag(name, options={})

and :range => 1..10 or :min => 1, :max => 10 as an option.


Reply to this email directly or view it on GitHubhttps://github.com/padrino/padrino-framework/issues/1276#issuecomment-17983621
.

Contributor

dariocravero commented May 16, 2013

Yeah, I know, I just thought that it would make it more explicit. Otherwise
you can always use input_tag :)

Darío

On 15 May 2013 23:05, Igor Bochkariov notifications@github.com wrote:

The HTML range works fine with no min and max. I think it would feel
better with

def range_field_tag(name, options={})

and :range => 1..10 or :min => 1, :max => 10 as an option.


Reply to this email directly or view it on GitHubhttps://github.com/padrino/padrino-framework/issues/1276#issuecomment-17983621
.

@postmodern

This comment has been minimized.

Show comment
Hide comment
@postmodern

postmodern May 16, 2013

Contributor

I like how all the form helpers access name then options.

Contributor

postmodern commented May 16, 2013

I like how all the form helpers access name then options.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero May 16, 2013

Contributor

Good, we'll follow that convention then. Whomever wants to implement it along with the tests, go ahead. I can try to do it but it won't be until next week.

Contributor

dariocravero commented May 16, 2013

Good, we'll follow that convention then. Whomever wants to implement it along with the tests, go ahead. I can try to do it but it won't be until next week.

Ortuna added a commit to Ortuna/padrino-framework that referenced this issue May 25, 2013

Added range_field_tag
closes #1276 if acceptable

defines:
```
	range_field_tag(name, options = {})
```
options are:
- name
- :min/:max
  - or :range

see PR + doc for formal definition.

Ortuna added a commit to Ortuna/padrino-framework that referenced this issue May 25, 2013

Added range_field_tag
closes #1276 if acceptable

defines:
```
	range_field_tag(name, options = {})
```
options are:
- name
- :min/:max
  - or :range

see PR + doc for formal definition.

Merged range_field_tag.* templates into form_tag.* should be the correct place

@ujifgc ujifgc closed this in #1299 May 25, 2013

WaYdotNET added a commit to WaYdotNET/padrino-framework that referenced this issue May 27, 2013

Merge remote-tracking branch 'upstream/master' into refresh-admin
* upstream/master:
  Changed range option parsing to a simpler code
  Merged range_field_tag.* templates into form_tag.* should be the correct place
  Added range_field_tag closes #1276 if acceptable

deni64k added a commit to deni64k/padrino-framework that referenced this issue Jul 16, 2013

Added range_field_tag
closes #1276 if acceptable

defines:
```
	range_field_tag(name, options = {})
```
options are:
- name
- :min/:max
  - or :range

see PR + doc for formal definition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment