Module: ImagesHelper

Defined in:
app/helpers/images_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_field(f) ⇒ Object


2
3
4
5
6
7
8
9
10
# File 'app/helpers/images_helper.rb', line 2

def image_field f
  return unless @compute_resource.capabilities.include?(:image)
  images = @compute_resource.available_images
  if images.any?
    return select_f(f, :uuid, images.to_a.sort! { |a, b| a.name.downcase <=> b.name.downcase }, :id, :name, {}, :label => _('Image'))
  else
    text_f f, :uuid, :label => _("Image ID"), :help_inline => _("Image ID as provided by the compute resource, e.g. ami-..")
  end
end