Sha256: 51e4a2c58044e208ec6098b97c1d01368e9c7a1810258cf0946e9dc026951b04
Contents?: true
Size: 1008 Bytes
Versions: 6
Compression:
Stored size: 1008 Bytes
Contents
class BrickLayer::AdministratorsController < BrickLayer::BaseController before_filter :find_admin, :except => [:index, :new, :create] respond_to :html def index @administrators = BrickLayer::Administrator.all end def new @administrator = BrickLayer::Administrator.new end def create @administrator = BrickLayer::Administrator.new(params[:administrator]) if @administrator.save flash[:success] = "You Created a New Administrator!" redirect_to administrators_path else render "new" end end def update if @administrator.update_attributes(params[:administrator]) flash[:success] = "Administrator Updated!" redirect_to administrators_path else render "edit" end end def destroy @administrator.destroy flash[:success] = "Administrator Removed!" redirect_to administrators_path end private def find_admin @administrator = BrickLayer::Administrator.find(params[:id]) end end
Version data entries
6 entries across 6 versions & 1 rubygems