Sha256: 94ae68b537783f2d1cb4a5d0a3550af94bf539aced7a14169273bdce431fc03c

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

module Amalgam
  class Admin::GroupsController < Admin::BaseController

    def index
      @groups = Amalgam::Models::Group.all
    end

    def edit
      @group = Amalgam::Models::Group.find(params[:id])
    end

    def show
      @group = Amalgam::Models::Group.find(params[:id])
    end

    def new
      @group = Amalgam::Models::Group.new
    end

    def update
      @group = Amalgam::Models::Group.find(params[:id])
      respond_to do |format|
        format.html do
          if @group.update_attributes(params[:group])
            redirect_to admin_groups_path
          else
            render 'edit'
          end
        end
      end
    end

    def create
      @group = Amalgam::Models::Group.new(params[:group])
      respond_to do |format|
        format.html do
          if @group.save
            redirect_to admin_groups_path
          else
            render 'new'
          end
        end
      end
    end

    def destroy
      @group = Amalgam::Models::Group.find(params[:id])
      @group.destroy
      respond_to do |format|
        format.html{ redirect_to admin_groups_path}
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amalgam-2.1.4.1 app/controllers/amalgam/admin/groups_controller.rb
amalgam-2.1.4 app/controllers/amalgam/admin/groups_controller.rb
amalgam-2.1.3.1 app/controllers/amalgam/admin/groups_controller.rb
amalgam-2.1.3 app/controllers/amalgam/admin/groups_controller.rb
amalgam-2.1.2 app/controllers/amalgam/admin/groups_controller.rb
amalgam-2.1.1 app/controllers/amalgam/admin/groups_controller.rb