Sha256: e0656bc51fc45e3cce59be0508ab7da46cdc935860ed1d33aa2fcaf9cbc09f48
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require_dependency 'comable/admin/application_controller' module Comable module Admin class UsersController < Comable::Admin::ApplicationController include Comable::PermittedAttributes load_and_authorize_resource class: Comable::User.name, except: :index def index @q = Comable::User.ransack(params[:q]) @users = @q.result.page(params[:page]).accessible_by(current_ability).by_newest respond_to do |format| format.html format.json { render json: @users } end end def show end def edit end def update if @user.update_attributes(user_params) redirect_to comable.admin_user_path(@user), notice: Comable.t('successful') else flash.now[:alert] = Comable.t('failure') render :edit end end def profile @user = current_comable_user render :edit end private def user_params params.require(:user).permit( :email, :password, :role, bill_address_attributes: permitted_address_attributes ) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
comable-backend-0.7.1 | app/controllers/comable/admin/users_controller.rb |
comable-backend-0.7.0 | app/controllers/comable/admin/users_controller.rb |