adbanner-test/app/views/admin/ad_images/new.html.erb

24 lines
651 B
Plaintext

<%= form_for(@ad_image, url: {action: "create"}) do |f| %>
<% I18n.available_locales.each do |locale| %>
Title <%= locale.to_s %>:
<%= f.fields_for :title_translations do |n| %>
<%= n.text_field locale %>
<% end %>
Context <%= locale.to_s %>:
<%= f.fields_for :context_translations do |n| %>
<%= n.text_area locale %>
<% end %>
<% end %>
<p>
<label>Image</label>
<%= image_tag(@ad_image.file_url) if @ad_image.file? %>
<%= f.file_field :file %>
<%= f.hidden_field :file_cache %>
</p>
<%= f.select :banner_id, @ad_banners.collect{|t| [ t.title, t.id ]} %>
<%= f.submit "Create Banner Image" %>
<% end %>