Module: Imgix::ActionView::Helpers

Defined in:
lib/imgix/action_view/helpers.rb

Instance Method Summary collapse

Instance Method Details

#imgix_tag(object, style, html_options = {}) ⇒ Object

Simple image_tag override that uses imgix as the source



5
6
7
# File 'lib/imgix/action_view/helpers.rb', line 5

def imgix_tag(object, style, html_options = {})
  image_tag(imgix_url(object, style), html_options)
end

#imgix_url(object, style) ⇒ Object

Helper that will return only a url



10
11
12
13
14
15
16
# File 'lib/imgix/action_view/helpers.rb', line 10

def imgix_url(object, style)
  if object && object.respond_to?('url')
    object.url(style)
  else
    Attachment.url(object, style)
  end
end