Sha256: 899eb30824d0a942d079f531ff322fdc4c8ba5ad640fb3b779e52c41aa855f3a

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

class GroupsController < ApplicationController

  #权限设置
  #汤建华
  def create
    role = Role.find params[:role_id]
    if params[:function_id]
      function_ids=params[:function_id]
      Group.transaction do
        Group.delete_all(:role_id => role.id)
        function_ids.each do |function_id|
          function= Function.find(function_id)
          Group.create(:role_id => role.id, :function_id => function.id)
        end
      end
    end
    redirect_to roles_path
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
admin-sys-1.1.0 app/controllers/groups_controller.rb