Class: Gemgento::Magento::UserGroupsController

Inherits:
BaseController show all
Defined in:
app/controllers/gemgento/magento/user_groups_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#validate_ip

Instance Method Details

#destroyObject



13
14
15
16
17
18
19
# File 'app/controllers/gemgento/magento/user_groups_controller.rb', line 13

def destroy
  if @user_group = UserGroup.find_by(magento_id: params[:id])
    @user_group.destroy
  end

  render nothing: true
end

#updateObject



5
6
7
8
9
10
11
# File 'app/controllers/gemgento/magento/user_groups_controller.rb', line 5

def update
  @user_group = UserGroup.find_or_initialize_by(magento_id: params[:id])
  @user_group.code = params[:data][:code]
  @user_group.save

  render nothing: true
end