Class: Forge::TaxRatesController

Inherits:
ForgeController show all
Defined in:
lib/forge/app/controllers/forge/tax_rates_controller.rb

Instance Method Summary collapse

Methods inherited from ForgeController

#get_menu_items, #load_help, #set_crumbs, #set_title, #uses_ckeditor

Methods inherited from ApplicationController

#app_init

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/forge/app/controllers/forge/tax_rates_controller.rb', line 15

def create
  @tax_rate = TaxRate.new(params[:tax_rate])
  if @tax_rate.save
    flash[:notice] = 'Tax rate was successfully created.'
    redirect_to(forge_tax_rates_path)
  else
    get_tax_rates
    render :action => "index"
  end
end

#destroyObject



35
36
37
38
# File 'lib/forge/app/controllers/forge/tax_rates_controller.rb', line 35

def destroy
  @tax_rate.destroy
  redirect_to(forge_tax_rates_path)
end

#editObject



11
12
13
# File 'lib/forge/app/controllers/forge/tax_rates_controller.rb', line 11

def edit
  render :layout => false
end

#indexObject



4
5
6
7
8
9
# File 'lib/forge/app/controllers/forge/tax_rates_controller.rb', line 4

def index
  @tax_rate = TaxRate.new
  respond_to do |format|
    format.html { get_tax_rates }
  end
end

#updateObject



26
27
28
29
30
31
32
33
# File 'lib/forge/app/controllers/forge/tax_rates_controller.rb', line 26

def update
  if @tax_rate.update_attributes(params[:tax_rate])
    flash[:notice] = 'Tax rate was successfully updated.'
    redirect_to(forge_tax_rates_path)
  else
    render :action => "edit"
  end
end