Class: Workarea::Admin::TaxCategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/workarea/admin/tax_categories_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 18

def create
  if @category.save
    flash[:success] = t('workarea.admin.tax_categories.flash_messages.created')
    redirect_to tax_category_path(@category)
  else
    render :new
  end
end

#destroyObject



36
37
38
39
40
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 36

def destroy
  @category.destroy
  flash[:success] = t('workarea.admin.tax_categories.flash_messages.removed')
  redirect_to tax_categories_path
end

#editObject



16
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 16

def edit; end

#indexObject



7
8
9
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 7

def index
  @categories = Tax::Category.all
end

#newObject



14
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 14

def new; end

#showObject



11
12
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 11

def show
end

#updateObject



27
28
29
30
31
32
33
34
# File 'app/controllers/workarea/admin/tax_categories_controller.rb', line 27

def update
  if @category.update_attributes(params[:category])
    flash[:success] = t('workarea.admin.tax_categories.flash_messages.saved')
    redirect_to tax_category_path(@category)
  else
    render :edit
  end
end