Basic function for AdBanner

This commit is contained in:
Matthew Kaito Juyuan Fu authored and Christophe Vilayphiou committed 2012-02-01 14:27:51 +08:00
1 parent 3287b68354
commit a980847eb3
15 files changed
+298

No files matched your search

@@ -0,0 +1,43 @@
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