Sha256: b3f2fe178bcc60dbeda27801bddc5bf88ba7727d6109885eb1c9f651b0fb1c06

Contents?: true

Size: 1.28 KB

Versions: 53

Compression:

Stored size: 1.28 KB

Contents

module Burp
  class GroupsController < Burp::ApplicationController
  
    def edit
      @menu = Menu.find(params[:menu_id])
      @menu.update_id("")
      @group = @menu.all_children().select {|child| child.id.to_s == params[:id].to_s}.first
    end
  
    def update
      @menu = Menu.find(params[:menu_id])
      @menu.update_id("")
      @group = @menu.all_children().select {|child| child.id.to_s == params[:id].to_s}.first
      @group.name = params[:group][:name]
      @menu.save
    
      redirect_to edit_menu_path(@menu)
    end
    
    def destroy
      @menu = Menu.find(params[:menu_id])
      @menu.update_id("")
      @group_to_remove = @menu.all_children().select {|child| child.id.to_s == params[:id].to_s}.first
      @group = (@menu.all_children+[@menu]).select {|child| child.is_a?(Group) && child.children.include?(@group_to_remove)}.first
      @group.children.delete(@group_to_remove)
      @menu.save
    
      redirect_to edit_menu_path(@menu)
    end
  
  
    def new
      @menu = Menu.find(params[:menu_id])
      @group = nil
      
      render :action => :edit
    end
  
    def create
      @menu = Menu.find(params[:menu_id])
      @menu.children << Group.new(params[:group][:name])
      @menu.save
    
      redirect_to edit_menu_path(@menu)
    end
  
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
burp_cms-1.7.1 app/controllers/burp/groups_controller.rb
burp_cms-1.7.0 app/controllers/burp/groups_controller.rb
burp_cms-1.6.0 app/controllers/burp/groups_controller.rb
burp_cms-1.5.13 app/controllers/burp/groups_controller.rb
burp_cms-1.5.12 app/controllers/burp/groups_controller.rb
burp_cms-1.5.11 app/controllers/burp/groups_controller.rb
burp_cms-1.5.10 app/controllers/burp/groups_controller.rb
burp_cms-1.5.9 app/controllers/burp/groups_controller.rb
burp_cms-1.5.8 app/controllers/burp/groups_controller.rb
burp_cms-1.5.7 app/controllers/burp/groups_controller.rb
burp_cms-1.5.6 app/controllers/burp/groups_controller.rb
burp_cms-1.5.5 app/controllers/burp/groups_controller.rb
burp_cms-1.5.4 app/controllers/burp/groups_controller.rb
burp_cms-1.5.3 app/controllers/burp/groups_controller.rb
burp_cms-1.5.2 app/controllers/burp/groups_controller.rb
burp_cms-1.5.1 app/controllers/burp/groups_controller.rb
burp_cms-1.5.0 app/controllers/burp/groups_controller.rb
burp_cms-1.4.1 app/controllers/burp/groups_controller.rb
burp_cms-1.4.0 app/controllers/burp/groups_controller.rb
burp_cms-1.3.33 app/controllers/burp/groups_controller.rb