Class: Eboshi::BudgetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eboshi/budgets_controller.rb

Instance Method Summary collapse

Methods included from ShallowRouteHelper

#assignment_path, #assignments_path, #convert_work_path, #edit_adjustment_path, #edit_invoice_path, #edit_work_path, #invoice_path, #invoices_path, #line_item_path, #merge_works_path, #new_adjustment_path, #new_assignment_path, #new_invoice_path, #new_payment_path, #payments_path, #work_path

Instance Method Details

#createObject



10
11
12
13
14
# File 'app/controllers/eboshi/budgets_controller.rb', line 10

def create
  @budget = @client.budgets.build(params[:budget])
  @budget.save!
  redirect_to [@client, :invoices], notice: "Budget created"
end

#destroyObject



27
28
29
30
# File 'app/controllers/eboshi/budgets_controller.rb', line 27

def destroy
  @client.budgets.destroy(params[:id])
  redirect_to [@client, :invoices], notice: "Budget destroy"
end

#editObject



16
17
18
19
# File 'app/controllers/eboshi/budgets_controller.rb', line 16

def edit
  @budget = @client.budgets.find(params[:id])
  render :form
end

#newObject



5
6
7
8
# File 'app/controllers/eboshi/budgets_controller.rb', line 5

def new
  @budget = @client.budgets.build
  render :form
end

#updateObject



21
22
23
24
25
# File 'app/controllers/eboshi/budgets_controller.rb', line 21

def update
  @budget = @client.budgets.find(params[:id])
  @budget.update!(params[:budget])
  redirect_to [@client, :invoices], notice: "Budget updated"
end