scaffold models
This commit is contained in:
2
app/views/crm/customers/_crm_customer.json.jbuilder
Normal file
2
app/views/crm/customers/_crm_customer.json.jbuilder
Normal 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)
|
||||
18
app/views/crm/customers/_form.html.erb
Normal file
18
app/views/crm/customers/_form.html.erb
Normal 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 %>
|
||||
6
app/views/crm/customers/edit.html.erb
Normal file
6
app/views/crm/customers/edit.html.erb
Normal 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 %>
|
||||
41
app/views/crm/customers/index.html.erb
Normal file
41
app/views/crm/customers/index.html.erb
Normal 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 %>
|
||||
1
app/views/crm/customers/index.json.jbuilder
Normal file
1
app/views/crm/customers/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @crm_customers, partial: 'crm_customers/crm_customer', as: :crm_customer
|
||||
5
app/views/crm/customers/new.html.erb
Normal file
5
app/views/crm/customers/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Crm Customer</h1>
|
||||
|
||||
<%= render 'form', crm_customer: @crm_customer %>
|
||||
|
||||
<%= link_to 'Back', crm_customers_path %>
|
||||
44
app/views/crm/customers/show.html.erb
Normal file
44
app/views/crm/customers/show.html.erb
Normal 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 %>
|
||||
1
app/views/crm/customers/show.json.jbuilder
Normal file
1
app/views/crm/customers/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "crm_customers/crm_customer", crm_customer: @crm_customer
|
||||
Reference in New Issue
Block a user