mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update customers_controller.rb
This commit is contained in:
@@ -18,7 +18,7 @@ class CustomersController < ApplicationController
|
|||||||
|
|
||||||
# display a list of all customers
|
# display a list of all customers
|
||||||
def index
|
def index
|
||||||
@customers = QboCustomer.paginate(:page => params[:page])
|
@customers = Customer.paginate(:page => params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@@ -31,7 +31,7 @@ class CustomersController < ApplicationController
|
|||||||
|
|
||||||
# display a specific customer
|
# display a specific customer
|
||||||
def show
|
def show
|
||||||
@customer = QboCustomer.find_by_id(params[:id])
|
@customer = Customer.find_by_id(params[:id])
|
||||||
if @customer
|
if @customer
|
||||||
@vehicles = @customer.vehicles.paginate(:page => params[:page])
|
@vehicles = @customer.vehicles.paginate(:page => params[:page])
|
||||||
else
|
else
|
||||||
@@ -42,12 +42,12 @@ class CustomersController < ApplicationController
|
|||||||
|
|
||||||
# return an HTML form for editing a customer
|
# return an HTML form for editing a customer
|
||||||
def edit
|
def edit
|
||||||
@customer = QboCustomer.find_by_id(params[:id])
|
@customer = Customer.find_by_id(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# update a specific customer
|
# update a specific customer
|
||||||
def update
|
def update
|
||||||
@customer = QboCustomer.find_by_id(params[:id])
|
@customer = Customer.find_by_id(params[:id])
|
||||||
if @customer.update_attributes(params[:customer])
|
if @customer.update_attributes(params[:customer])
|
||||||
flash[:success] = "Customer updated"
|
flash[:success] = "Customer updated"
|
||||||
redirect_to @customer
|
redirect_to @customer
|
||||||
|
|||||||
Reference in New Issue
Block a user