Class: BsFileDownloadInput
- Inherits:
-
Formtastic::Inputs::StringInput
- Object
- Formtastic::Inputs::StringInput
- BsFileDownloadInput
- Includes:
- ActionView::Context, ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper, FormtasticBootstrap::Inputs::Base, FormtasticBootstrap::Inputs::Base::Collections
- Defined in:
- app/input/bs_file_download_input.rb
Instance Method Summary collapse
-
#to_html ⇒ Object
Passare nelle opzioni la chiave :content con una proc che richiamo per generare il buffer.
Instance Method Details
#to_html ⇒ Object
Passare nelle opzioni la chiave :content con una proc che richiamo per generare il buffer
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/input/bs_file_download_input.rb', line 12 def to_html bootstrap_wrapping do content_tag(:div, class: 'input-group bs_label_with_content') do content_tag(:div, class: 'row') do tmp = ActiveSupport::SafeBuffer.new tmp << content_tag(:div, class: "col-md-6") do builder.input method, :label => false end if object.send(method).exists? tmp << content_tag(:div, class: "col-md-6 col-lg-6") do link_to I18n.t('formtastic.inputs.bs_file_download.download'), object.send(method).url, class: 'btn btn-default' end end tmp end end end end |