Class: Bureaucrat::Widgets::FileInput
Constant Summary
Constants included
from Utils
Utils::ESCAPES
Instance Attribute Summary
Attributes inherited from Widget
#attrs, #is_required
Instance Method Summary
collapse
Methods inherited from Widget
#build_attrs, #hidden?, id_for_label, #initialize, #initialize_copy
Methods included from Utils
#blank_value?, #conditional_escape, #escape, #flatatt, #format_string, #make_bool, #make_float, #mark_safe, #pretty_name
Instance Method Details
#has_changed?(initial, data) ⇒ Boolean
146
147
148
|
# File 'lib/bureaucrat/widgets.rb', line 146
def has_changed?(initial, data)
data.nil?
end
|
150
151
152
|
# File 'lib/bureaucrat/widgets.rb', line 150
def input_type
'file'
end
|
#needs_multipart? ⇒ Boolean
154
155
156
|
# File 'lib/bureaucrat/widgets.rb', line 154
def needs_multipart?
true
end
|
#render(name, value, attrs = nil) ⇒ Object
138
139
140
|
# File 'lib/bureaucrat/widgets.rb', line 138
def render(name, value, attrs=nil)
super(name, nil, attrs)
end
|
142
143
144
|
# File 'lib/bureaucrat/widgets.rb', line 142
def value_from_formdata(data, name)
data[name] && TemporaryUploadedFile.new(data[name])
end
|