Sha256: 1cb675082ae4f2523d731d6a10ccec6c12006db21b22b465ecb0d91ce002b7e3

Contents?: true

Size: 1.68 KB

Versions: 8

Compression:

Stored size: 1.68 KB

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class Admin::GroupsController < Admin::ApplicationController
  before_action :setup_current_tab, only: %i[index show]

  load_resource

  # GET /groups
  #----------------------------------------------------------------------------
  def index
    @groups = @groups.unscoped.paginate(page: params[:page])
  end

  # GET /groups/1
  #----------------------------------------------------------------------------
  def show
    respond_with(@group)
  end

  # GET /groups/new
  #----------------------------------------------------------------------------
  def new
    respond_with(@group)
  end

  # GET /groups/1/edit
  #----------------------------------------------------------------------------
  def edit
    respond_with(@group)
  end

  # POST /groups
  #----------------------------------------------------------------------------
  def create
    @group.attributes = group_params
    @group.save

    respond_with(@group)
  end

  # PUT /groups/1
  #----------------------------------------------------------------------------
  def update
    @group.update_attributes(group_params)

    respond_with(@group)
  end

  # DELETE /groups/1
  #----------------------------------------------------------------------------
  def destroy
    @group.destroy

    respond_with(@group)
  end

  protected

  def group_params
    params[:group].permit!
  end

  def setup_current_tab
    set_current_tab('admin/groups')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fat_free_crm-0.15.2 app/controllers/admin/groups_controller.rb
fat_free_crm-0.16.4 app/controllers/admin/groups_controller.rb
fat_free_crm-0.15.1 app/controllers/admin/groups_controller.rb
fat_free_crm-0.16.3 app/controllers/admin/groups_controller.rb
fat_free_crm-0.16.2 app/controllers/admin/groups_controller.rb
fat_free_crm-0.16.1 app/controllers/admin/groups_controller.rb
fat_free_crm-0.16.0 app/controllers/admin/groups_controller.rb
fat_free_crm-0.15.0 app/controllers/admin/groups_controller.rb