Class: Admin::BusinessAreasController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/business_areas_controller.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) create

Create a biz area



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controllers/admin/business_areas_controller.rb', line 40

def create
  @business_area = BusinessArea.new(params[:business_area])

  respond_to do |format|
    if @business_area.save
      format.html { redirect_to(edit_business_area_path(@business_area), :notice => 'Biz Process was successfully created.') }
      format.xml  { render :xml => @business_area, :status => :created, :location => @business_area }
    else
      flash.now[:error] = "Could not create."
      format.html { render :action => "new" }
      format.xml  { render :xml => @business_area.errors, :status => :unprocessable_entity }
    end
  end
end

- (Object) destroy

Delete a biz area



72
73
74
75
76
77
78
79
# File 'app/controllers/admin/business_areas_controller.rb', line 72

def destroy
  business_area = BusinessArea.find(params[:id])

  respond_to do |format|
    format.html { redirect_to(business_areas_url) }
    format.xml  { head :ok }
  end
end

- (Object) edit

Edit biz area form



35
36
37
# File 'app/controllers/admin/business_areas_controller.rb', line 35

def edit
  @business_area = BusinessArea.find(params[:id])
end

- (Object) index

List of biz areas



5
6
7
8
9
10
11
12
# File 'app/controllers/admin/business_areas_controller.rb', line 5

def index
  @business_areas = BusinessArea.all

  respond_to do |format|
    format.html # index.html.erb
    format.xml  { render :xml => @business_areas }
  end
end

- (Object) new

New biz area form



25
26
27
28
29
30
31
32
# File 'app/controllers/admin/business_areas_controller.rb', line 25

def new
  @business_area = BusinessArea.new

  respond_to do |format|
    format.html # new.html.erb
    format.xml  { render :xml => @business_area }
  end
end

- (Object) show

Show a biz area



15
16
17
18
19
20
21
22
# File 'app/controllers/admin/business_areas_controller.rb', line 15

def show
  @business_area = BusinessArea.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.xml  { render :xml => @business_area }
  end
end

- (Object) update

Update a biz area



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'app/controllers/admin/business_areas_controller.rb', line 56

def update
  @business_area = BusinessArea.find(params[:id])

  respond_to do |format|
    if @business_area.update_attributes(params[:business_area])
      format.html { redirect_to(edit_business_area_path(@business_area), :notice => 'Biz Process was successfully updated.') }
      format.xml  { head :ok }
    else
      flash.now[:error] = "Could not update."
      format.html { render :action => "edit" }
      format.xml  { render :xml => @business_area.errors, :status => :unprocessable_entity }
    end
  end
end