2010-01-09 15:05:02 +00:00
|
|
|
module SimpleForm
|
|
|
|
module Inputs
|
2010-02-03 14:56:27 +00:00
|
|
|
class PriorityInput < CollectionInput
|
2010-01-09 15:05:02 +00:00
|
|
|
def input
|
|
|
|
@builder.send(:"#{input_type}_select", attribute_name, input_priority,
|
|
|
|
input_options, input_html_options)
|
|
|
|
end
|
|
|
|
|
|
|
|
def input_priority
|
|
|
|
options[:priority] || SimpleForm.send(:"#{input_type}_priority")
|
|
|
|
end
|
2010-02-03 14:56:27 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def skip_include_blank?
|
|
|
|
super || input_priority.present?
|
|
|
|
end
|
2010-01-09 15:05:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|