Module: Authentasaurus::Ac::Controllers::AreasController::InstanceMethods
- Defined in:
- lib/authentasaurus/ac/controllers/areas_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
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 |
#index ⇒ Object
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 |
#new ⇒ Object
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 |
#show ⇒ Object
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 |
#update ⇒ Object
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 |