Class: BetterRailsDebugger::AnalysisGroupsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- BetterRailsDebugger::AnalysisGroupsController
- Defined in:
- app/controllers/better_rails_debugger/analysis_groups_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
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 24 def create @group = AnalysisGroup.new analysis_group_params if @group.save redirect_to analysis_groups_path, notice: 'Successfully created!' else flash.now[:error] = @group.errors. render 'new' end end |
#destroy ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 55 def destroy if !@group redirect_to analysis_groups_path, notice: 'Analysis group not found' return end @group.destroy redirect_to analysis_groups_path, notice: 'Analysis group destroyed' end |
#edit ⇒ Object
34 35 36 37 38 39 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 34 def edit if !@group redirect_to analysis_groups_path, notice: 'Analysis group not found' return end end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 8 def index @groups = AnalysisGroup.order(name: 'asc').limit(20).paginate(page: (params[:page] || 1), per_page: 20) end |
#new ⇒ Object
20 21 22 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 20 def new @group = AnalysisGroup.new end |
#show ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 12 def show if !@group redirect_to analysis_groups_path, notice: 'Analysis group not found' return end @instances = @group.group_instances.order(created_at: 'desc').limit(20).paginate(page: (params[:page] || 1), per_page: 20) end |
#update ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/better_rails_debugger/analysis_groups_controller.rb', line 41 def update if !@group redirect_to analysis_groups_path, notice: 'Analysis group not found' return end if @group.update_attributes(analysis_group_params) redirect_to analysis_groups_path, notice: 'Updated successfully' return else flash.now[:error] = @group.errors. render 'edit' end end |