updateCommissioner
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class Origami::CommissionersController < BaseOrigamiController
|
class Origami::CommissionersController < BaseOrigamiController
|
||||||
# before_action :set_commissioner, only: [:show, :edit, :update, :destroy]
|
before_action :set_commissioner, only: [:show, :edit, :update, :destroy]
|
||||||
|
|
||||||
# GET /commissioners
|
# GET /commissioners
|
||||||
# GET /commissioners.json
|
# GET /commissioners.json
|
||||||
@@ -29,7 +29,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
|||||||
@commissioner.created_by = current_user.id
|
@commissioner.created_by = current_user.id
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @commissioner.save
|
if @commissioner.save
|
||||||
format.html { redirect_to @commissioner, notice: 'Commissioner was successfully created.' }
|
format.html { redirect_to origami_commissioners_path , notice: 'Commissioner was successfully created.' }
|
||||||
format.json { render :show, status: :created, location: @commissioner }
|
format.json { render :show, status: :created, location: @commissioner }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
@@ -43,7 +43,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
|||||||
def update
|
def update
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @commissioner.update(commissioner_params)
|
if @commissioner.update(commissioner_params)
|
||||||
format.html { redirect_to @commissioner, notice: 'Commissioner was successfully updated.' }
|
format.html { redirect_to origami_commissioner_path(@commissioner) , notice: 'Commissioner was successfully updated.' }
|
||||||
format.json { render :show, status: :ok, location: @commissioner }
|
format.json { render :show, status: :ok, location: @commissioner }
|
||||||
else
|
else
|
||||||
format.html { render :edit }
|
format.html { render :edit }
|
||||||
@@ -57,7 +57,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
|||||||
def destroy
|
def destroy
|
||||||
@commissioner.destroy
|
@commissioner.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to commissioners_url, notice: 'Commissioner was successfully destroyed.' }
|
format.html { redirect_to origami_commissioners_path , notice: 'Commissioner was successfully destroyed.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
|
||||||
<hr class="hr_advance" />
|
<hr class="hr_advance" />
|
||||||
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Commissioners", commissioners_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Commissioners", origami_commissioners_path , :tabindex =>"-1" %></li>
|
||||||
<hr class="hr_advance" />
|
<hr class="hr_advance" />
|
||||||
<li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li>
|
||||||
<hr class="hr_advance" />
|
<hr class="hr_advance" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= simple_form_for(@commissioner) do |f| %>
|
<%= simple_form_for([:origami,@commissioner]) do |f| %>
|
||||||
<%= f.error_notification %>
|
<%= f.error_notification %>
|
||||||
|
|
||||||
<div class="form-inputs">
|
<div class="form-inputs">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= root_path %>">Home</a></li>
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
|
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
|
||||||
<li>Edit</li>
|
<li>Edit</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<li><a href="<%= %>">Home</a></li>
|
<li><a href="<%= %>">Home</a></li>
|
||||||
<li>Commissioner</li>
|
<li>Commissioner</li>
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_commissioner_path,:class => 'btn btn-primary btn-sm' %>
|
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commissioner_path ,:class => 'btn btn-primary btn-sm' %>
|
||||||
</span>
|
</span>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
<th>Employee Name</th>
|
<th>Employee Name</th>
|
||||||
<th>Commission type</th>
|
<th>Commission type</th>
|
||||||
<th>Active</th>
|
<th>Active</th>
|
||||||
<th>Created By</th>
|
|
||||||
<th colspan="3"></th>
|
<th colspan="3"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -35,10 +34,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td><%= commissioner.commission_type %></td>
|
<td><%= commissioner.commission_type %></td>
|
||||||
<td><%= commissioner.is_active %></td>
|
<td><%= commissioner.is_active %></td>
|
||||||
<td><%= current_user.name %></td>
|
<td><%= link_to 'Show', origami_commissioner_path(commissioner) %></td>
|
||||||
<td><%= link_to 'Show', commissioner_path(commissioner) %></td>
|
<td><%= link_to 'Edit', edit_origami_commissioner_path(commissioner) %></td>
|
||||||
<td><%= link_to 'Edit', edit_commissioner_path(commissioner) %></td>
|
<td><%= link_to 'Destroy', origami_commissioner_path(commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||||
<td><%= link_to 'Destroy', commissioner_path(commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= root_path %>">Home</a></li>
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
|
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
|
||||||
<li>New</li>
|
<li>New</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= root_path %>">Home</a></li>
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
|
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
|
||||||
|
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
</span>
|
</span>
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td style="width:20%">Commission Type</td><td><%= @commissioner.commission_type %></td></tr>
|
<tr><td style="width:20%">Commission Type</td><td><%= @commissioner.commission_type %></td></tr>
|
||||||
<tr><td style="width:20%">Active</td><td><%= @commissioner.is_active %></td></tr>
|
<tr><td style="width:20%">Active</td><td><%= @commissioner.is_active %></td></tr>
|
||||||
<tr><td style="width:20%">Created By</td><td><%= current_user.name %></td></tr>
|
<tr><td style="width:20%">Created By</td><td><%= Employee.find(@commissioner.created_by).name %></td></tr>
|
||||||
|
|
||||||
|
|
||||||
<tr><td style="width:20%"><%= link_to 'Edit', edit_commissioner_path(@commissioner) %></td><td><%= link_to 'Destroy', commissioner_path(@commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
|
<tr><td style="width:20%"><%= link_to 'Edit', edit_origami_commissioner_path(@commissioner) %></td><td><%= link_to 'Destroy', origami_commissioner_path(@commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user