Sha256: 9fe565cceaa2ae2a8dd3ee7f159e823b26406be25b8f209846bb282ffdc30984

Contents?: true

Size: 1016 Bytes

Versions: 9

Compression:

Stored size: 1016 Bytes

Contents

require_dependency "adeia/application_controller"

module Adeia
  class GroupUsersController < ApplicationController
    load_and_authorize

    def index
      @table = GroupUserTable.new(self, @group_users)
      @table.respond
    end

    def new
      @group_user = GroupUser.new
    end

    def create
      @group_user = GroupUser.new(group_user_params)
      if @group_user.save
        redirect_to group_users_path, success: t("adeia.group_users.create.success")
      else
        render 'new'
      end
    end

    def edit
    end

    def update
      if @group_user.update_attributes(group_user_params)
        redirect_to group_users_path, success: t("adeia.group_users.update.success")
      else
        render 'edit'
      end
    end

    def destroy
      @group_user.destroy
      redirect_to group_users_path, success: t("adeia.group_users.destroy.success")
    end

    private

    def group_user_params
      params.require(:group_user).permit(:user_id, :adeia_group_id)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
adeia-1.0.0 app/controllers/adeia/group_users_controller.rb
adeia-0.15.4 app/controllers/adeia/group_users_controller.rb
adeia-0.15.3 app/controllers/adeia/group_users_controller.rb
adeia-0.15.2 app/controllers/adeia/group_users_controller.rb
adeia-0.15.1 app/controllers/adeia/group_users_controller.rb
adeia-0.15.0 app/controllers/adeia/group_users_controller.rb
adeia-0.14.0 app/controllers/adeia/group_users_controller.rb
adeia-0.13.1 app/controllers/adeia/group_users_controller.rb
adeia-0.13.0 app/controllers/adeia/group_users_controller.rb