<%= form_for [@compute_resource, @image] do |f| %>
  <%= base_errors_for @image %>
  <%= text_f   f, :name %>
  <%= f.hidden_field :compute_resource_id, :value => @compute_resource.id %>
  <%= select_f f, :operatingsystem_id, Operatingsystem.all, :id, :to_label %>
  <%= select_f f, :architecture_id, Architecture.all, :id, :to_label %>
  <%= text_f f, :username, :value => @image.username || "root", :help_inline => _("The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc") %>
  <%= image_field(f) %>
  <%= checkbox_f f, :user_data, :help_inline => _("Does this image support user data input (e.g. via cloud-init)?") %>
  <% if @compute_resource.provider == 'EC2' %>
    <%# TODO - Get IAM roles from AWS and display in select drop %>
    <%= text_f f, :iam_role, :help_inline => _("(optional) IAM Role for Fog to use when creating this image.") %>
  <% end %>

  <%= submit_or_cancel f, false, :cancel_path => @compute_resource %>
<% end %>

