Sha256: 06776f0edfc58cacbf6337fba7e37a881916a9f9446c2db02f75cbcc90f3bec4
Contents?: true
Size: 662 Bytes
Versions: 14
Compression:
Stored size: 662 Bytes
Contents
class AdminsController < ApplicationController before_action :set_admin, only: [:show] # GET /admins def index render json: { users: Admin.all.as_json(include: :user, methods: [:printable_target_name, :notification_action_cable_allowed?, :notification_action_cable_with_devise?]) } end # GET /admins/:id def show render json: @admin.as_json(include: :user, methods: [:printable_target_name, :notification_action_cable_allowed?, :notification_action_cable_with_devise?]) end private # Use callbacks to share common setup or constraints between actions. def set_admin @admin = Admin.find(params[:id]) end end
Version data entries
14 entries across 14 versions & 1 rubygems