hpham17/esential-2016

View on GitHub
app/views/communities/new.html.erb

Summary

Maintainability
Test Coverage
<body style="background: #001f3f;">

<%= form_for @community, :html => {:id => "msform"}, validate: true do |f| %>
<fieldset class="bigger-field">
    <h3 class="fs-title">Create a Community</h3>

  <%= f.text_field :name, placeholder: 'Name * ' %><br />

  <%= f.text_field :description, placeholder: 'Description *' %><br />

  <%= f.text_field :number, placeholder: 'Phone Number *' %><br />

  <%= f.text_field :website, placeholder: 'Website' %><br />

  <%= f.text_field :total_loan_amount, placeholder: 'Total Loan Amount ($) *' %><br />

  <%= f.text_field :max_loan_amount, placeholder: 'Max Per Loan Amount ($) *' %><br />

  <%= f.text_field :interest_rate, placeholder: 'Interest Rate (%) *' %><br />

  <%= f.text_field :loan_period, placeholder: 'Loan Period (months) *' %><br />

  <%= f.text_field :terms, placeholder: 'Terms' %><br />

  <%= label_tag :address %>
  <%= f.fields_for :address, validate: true do |a| %>
    <%= a.text_field :house_number, placeholder: 'House # *', validate: {presence: true} %>
    <%= a.text_field :street, placeholder: 'Street *', validate: true %>
    <%= a.text_field :city, placeholder: 'City *', validate: true %>
    <%= a.text_field :state, placeholder: 'State *', validate: true %>
    <%= a.text_field :zip, placeholder: 'Zip *', validate: true %>
  <% end %>

  <div class="actions">
    <%= f.hidden_field :user_id, :value => current_user.id %>
  </div>


  <%= f.submit %>

  </fieldset>
<% end %>


</body>