Commit 995bd023 authored by jz143's avatar jz143

fixes app_file#_form layout

parent 4addef69
......@@ -2,7 +2,9 @@ class AppFile < ActiveRecord::Base
belongs_to :app
belongs_to :user
validates :app, presence: true
validates_inclusion_of :platform, :in => %w( Android iOS )
validates :version, presence: true
has_attached_file :archive
validates_attachment_file_name :archive, matches: [/apk\Z/, /zip\Z/]
......
<%= simple_form_for([@app_file.app, @app_file], html: { class: 'form-horizontal' }) do |f| %>
<%= f.input :platform, collection: ['iOS', 'Android'], as: :radio_buttons %>
<%= f.input :version %>
<%= f.input :archive, as: :file %>
<div class="row">
<div class="col-md-12">
<%= simple_form_for([@app_file.app, @app_file]) do |f| %>
<%= f.input :platform, collection: ['iOS', 'Android'], as: :radio_buttons, required: true %>
<%= f.input :version, required: true %>
<%= f.input :archive, as: :file, required: true %>
<%= f.button :submit, 'Upload New App Release' %>
<% end %>
<% end %>
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment