Sha256: 1697354449cd3a2c5d4d144f1c29d459efc081c91873064ad6388877cc7e1a42

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 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

3 entries across 3 versions & 1 rubygems

Version Path
admin-sys-1.0.2 app/controllers/groups_controller.rb
admin-sys-1.0.1 app/controllers/groups_controller.rb
admin-sys-1.0.0 app/controllers/groups_controller.rb