dobtco/dispatch

View on GitHub
app/views/users/registrations/_new_vendor.html.erb

Summary

Maintainability
Test Coverage
<% content_for(:page_title, t('.title')) %>
<% content_for(:main_container_class, 'container_tiny') %>

<div class='page_header page_header_simple'>
  <h2><%= t('.title') %></h2>
</div>

<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <input type='hidden' name='type' value='vendor' />

  <%= f.simple_fields_for :business_data, OpenStruct.new(f.object.business_data) do |f| %>
    <%= render partial: 'business_data', locals: { f: f } %>
  <% end %>

  <%= f.input :name, label: t('.name'), required: true %>
  <%= f.input :email, label: t('.email'), required: true %>
  <%= f.input :password, label: t('.password'), hint: t('password_hint'), required: true %>
  <%= f.input :business_name, label: t('.business_name.label'), hint: t('.business_name.hint') %>

  <%= f.input :subscribe_to_category_ids, label: t('.select_categories.label'), hint: t('.select_categories.hint'), as: :select, collection: Category.all, input_html: { multiple: true, 'data-no-styled-select' => true } %>

  <%= f.button :button, t('sign_up'), class: 'primary' %>
<% end %>