Sha256: 8784e3ef6a2a643b02e7733b916652ad860638d5ca9894e06ca6498a76ed391c

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

class PrettyFileInputInput < SimpleForm::Inputs::Base
  def input
    @builder.multipart = true
    PrettyFileInput::Component.new(
      name: tag_name,
      persisted: object.try(:persisted?),
      filename: object.try(:send, attribute_name).try(:file).try(:filename)
    ).to_html
  end

  # Not sure why this is so goddamn hard to retrieve
  def tag_name
    ActionView::Helpers::Tags::Base.new(object_name, attribute_name, nil).
      send(:tag_name)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pretty_file_input-0.0.2 app/inputs/pretty_file_input_input.rb