Module: Authentasaurus::Ac::Controllers::AreasController::InstanceMethods

Defined in:
lib/authentasaurus/ac/controllers/areas_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 36

def create
  @area = Area.new params[:area]
  
respond_to do |format|
	if @area.save
      format.html { redirect_to :action=>:index, :notice => "Area Created" }
    else
      flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :areas])
      format.html { render :new }
    end
  end
end

#destroyObject



70
71
72
73
74
75
76
77
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 70

def destroy
  @area = Area.find params[:id]
  @area.destroy
  
respond_to do |format|
    format.html { redirect_to :action=>:index }
  end
end

#editObject



49
50
51
52
53
54
55
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 49

def edit
  @area = Area.find params[:id]
  
respond_to do |format|
    format.html
  end
end

#indexObject



12
13
14
15
16
17
18
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 12

def index
  @areas= Area.find :all
  
respond_to do |format|
    format.html
  end
end

#newObject



28
29
30
31
32
33
34
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 28

def new
  @area = Area.new
  
respond_to do |format|
    format.html
  end
end

#showObject



20
21
22
23
24
25
26
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 20

def show
  @area = Area.find params[:id]
  
respond_to do |format|
    format.html
  end
end

#updateObject



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/authentasaurus/ac/controllers/areas_controller.rb', line 57

def update
  @area = Area.find params[:id]
  
respond_to do |format|
	if @area.update_attributes(params[:area])
      format.html { redirect_to :action => :index, :notice => "Area updated" }
    else
      flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :areas])
      format.html { render :edit }
    end
  end
end