This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/controllers/admin/ad_banners_controller.rb

43 lines
816 B
Ruby
Raw Normal View History

2012-01-31 10:31:31 +00:00
class Admin::AdBannersController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def destroy
@ad_banner = AdBanner.find(params[:id])
@ad_banner.destroy
redirect_to admin_ad_banners_url
end
def show
@ad_banner = AdBanner.find(params[:id])
end
def new
@ad_banner = AdBanner.new
end
def create
@ad_banner = AdBanner.new(params[:ad_banner])
@ad_banner.save
redirect_to admin_ad_banners_url
end
def edit
@ad_banner = AdBanner.find(params[:id])
end
def update
@ad_banner = AdBanner.find(params[:id])
@ad_banner.update_attributes(params[:ad_banner])
@ad_banner.save
redirect_to admin_ad_banners_url
end
def index
@ad_banners = AdBanner.all
end
end