scaffold models

This commit is contained in:
Min Zeya Phyo
2017-04-20 17:01:14 +06:30
parent 0a97947259
commit 0af7d78c3c
145 changed files with 4127 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at
json.url crm_customer_url(crm_customer, format: :json)

View File

@@ -0,0 +1,18 @@
<%= simple_form_for(@crm_customer) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.input :company %>
<%= f.input :contact_no %>
<%= f.input :email %>
<%= f.input :date_of_birth %>
<%= f.association :membership %>
<%= f.input :membership_type %>
<%= f.input :membership_authentication_code %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing Crm Customer</h1>
<%= render 'form', crm_customer: @crm_customer %>
<%= link_to 'Show', @crm_customer %> |
<%= link_to 'Back', crm_customers_path %>

View File

@@ -0,0 +1,41 @@
<p id="notice"><%= notice %></p>
<h1>Crm Customers</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Company</th>
<th>Contact no</th>
<th>Email</th>
<th>Date of birth</th>
<th>Membership</th>
<th>Membership type</th>
<th>Membership authentication code</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td><%= crm_customer.date_of_birth %></td>
<td><%= crm_customer.membership %></td>
<td><%= crm_customer.membership_type %></td>
<td><%= crm_customer.membership_authentication_code %></td>
<td><%= link_to 'Show', crm_customer %></td>
<td><%= link_to 'Edit', edit_crm_customer_path(crm_customer) %></td>
<td><%= link_to 'Destroy', crm_customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Crm Customer', new_crm_customer_path %>

View File

@@ -0,0 +1 @@
json.array! @crm_customers, partial: 'crm_customers/crm_customer', as: :crm_customer

View File

@@ -0,0 +1,5 @@
<h1>New Crm Customer</h1>
<%= render 'form', crm_customer: @crm_customer %>
<%= link_to 'Back', crm_customers_path %>

View File

@@ -0,0 +1,44 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @crm_customer.name %>
</p>
<p>
<strong>Company:</strong>
<%= @crm_customer.company %>
</p>
<p>
<strong>Contact no:</strong>
<%= @crm_customer.contact_no %>
</p>
<p>
<strong>Email:</strong>
<%= @crm_customer.email %>
</p>
<p>
<strong>Date of birth:</strong>
<%= @crm_customer.date_of_birth %>
</p>
<p>
<strong>Membership:</strong>
<%= @crm_customer.membership %>
</p>
<p>
<strong>Membership type:</strong>
<%= @crm_customer.membership_type %>
</p>
<p>
<strong>Membership authentication code:</strong>
<%= @crm_customer.membership_authentication_code %>
</p>
<%= link_to 'Edit', edit_crm_customer_path(@crm_customer) %> |
<%= link_to 'Back', crm_customers_path %>

View File

@@ -0,0 +1 @@
json.partial! "crm_customers/crm_customer", crm_customer: @crm_customer