Class: Components::Renderers::IframeTag

Inherits:
Base
  • Object
show all
Defined in:
app/components/renderers/iframe_tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.supports?(file) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'app/components/renderers/iframe_tag.rb', line 2

def self.supports?(file)
  FileHandlers::IframeTag.can_load? file&.mime_type
end

Instance Method Details

#view_template ⇒ Object



6
7
8
9
10
11
12
# File 'app/components/renderers/iframe_tag.rb', line 6

def view_template
  iframe(
    src: model_model_file_raw_path(@file.model, @file.filename),
    alt: @file.name,
    style: "width: 100%; aspect-ratio: 0.707"
  )
end