Skip to content

Commit

Permalink
Changed range option parsing to a simpler code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortuna committed May 25, 2013
1 parent 6c728d0 commit 5567c09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions padrino-helpers/lib/padrino-helpers/form_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,8 @@ def button_to(*args, &block)
# @api public
def range_field_tag(name, options = {})
options.reverse_merge!(:name => name)
if options[:range]
[:min, :max].each {|x| options[x] = options[:range].send(x) }
options.delete(:range)
if range = options.delete(:range)
options[:min], options[:max] = range.min, range.max
end
input_tag(:range, options)
end
Expand Down

0 comments on commit 5567c09

Please sign in to comment.