Sha256: 3ea706ce6f9a078bc3bf51b8039dafa22ac00b88093b60e5dc7bcc119b174db7
Contents?: true
Size: 735 Bytes
Versions: 12
Compression:
Stored size: 735 Bytes
Contents
class Admin::ManagersController < Admin::BaseController def index @managers = Manager.all end def new @manager = Manager.new render 'edit' end def create @manager = Manager.new(manager_params) redirect_or_edit(@manager, @manager.save) end def edit @manager = Manager.find(params[:id]) end def update @manager = Manager.find(params[:id]) redirect_or_edit(@manager, @manager.update(manager_params)) end def destroy @manager = Manager.find(params[:id]) @manager.destroy if current_manager.id != @manager.id redirect_to [:admin, :managers], alert: 'Администратор удален' end private def manager_params params[:manager].permit! end end
Version data entries
12 entries across 7 versions & 1 rubygems