Sha256: 5bc50edc7f976b3faa607e31c8081ed4507f59a8704a70f9bfdd65bf687805b2

Contents?: true

Size: 599 Bytes

Versions: 35

Compression:

Stored size: 599 Bytes

Contents

class Iugu::AccountRolesController < Iugu::SettingsController

  before_filter(:only => [:edit, :update]) { |c| c.must_be [:owner, :admin], :id }

  def edit
    @account = current_user.accounts.find(params[:id])
    @account_user = @account.account_users.find_by_user_id(params[:user_id])
  end

  def update
    @account = current_user.accounts.find(params[:id])
    @account_user = @account.account_users.find_by_user_id(params[:user_id])
    @account_user.set_roles(params[:roles])
    redirect_to account_users_index_path(@account), :notice => I18n.t("iugu.notices.roles_changed")
  end
  
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.23 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.22 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.21 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.20 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.19 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.18 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.17 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.16 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.14 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.13 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.12 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.11 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.10 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.9 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.7 app/controllers/iugu/account_roles_controller.rb