updateCommissioner
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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.json
|
||||
@@ -29,7 +29,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
||||
@commissioner.created_by = current_user.id
|
||||
respond_to do |format|
|
||||
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 }
|
||||
else
|
||||
format.html { render :new }
|
||||
@@ -43,7 +43,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
||||
def update
|
||||
respond_to do |format|
|
||||
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 }
|
||||
else
|
||||
format.html { render :edit }
|
||||
@@ -57,7 +57,7 @@ class Origami::CommissionersController < BaseOrigamiController
|
||||
def destroy
|
||||
@commissioner.destroy
|
||||
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 }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
|
||||
<hr class="hr_advance" />
|
||||
<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" />
|
||||
<li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li>
|
||||
<hr class="hr_advance" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for(@commissioner) do |f| %>
|
||||
<%= simple_form_for([:origami,@commissioner]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Commissioner</li>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -17,7 +17,6 @@
|
||||
<th>Employee Name</th>
|
||||
<th>Commission type</th>
|
||||
<th>Active</th>
|
||||
<th>Created By</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -35,10 +34,9 @@
|
||||
</td>
|
||||
<td><%= commissioner.commission_type %></td>
|
||||
<td><%= commissioner.is_active %></td>
|
||||
<td><%= current_user.name %></td>
|
||||
<td><%= link_to 'Show', commissioner_path(commissioner) %></td>
|
||||
<td><%= link_to 'Edit', edit_commissioner_path(commissioner) %></td>
|
||||
<td><%= link_to 'Destroy', commissioner_path(commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= link_to 'Show', origami_commissioner_path(commissioner) %></td>
|
||||
<td><%= 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>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<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>
|
||||
@@ -25,10 +25,10 @@
|
||||
</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%">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>
|
||||
|
||||
Reference in New Issue
Block a user