mirror of
https://github.com/moebooru/moebooru
synced 2025-08-22 01:47:48 +00:00
branch : moe extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%405
21 lines
456 B
Ruby
21 lines
456 B
Ruby
class AdvertisementController < ApplicationController
|
|
layout "bare"
|
|
before_filter :admin_only, :only => [:reset_stats]
|
|
|
|
def redirect_ad
|
|
ad = Advertisement.find(params[:id])
|
|
ad.increment!(:hit_count)
|
|
redirect_to ad.referral_url
|
|
end
|
|
|
|
def show_stats
|
|
@ads = Advertisement.find(:all, :order => "id")
|
|
render :layout => "default"
|
|
end
|
|
|
|
def reset_stats
|
|
Advertisement.update_all("hit_count = 0")
|
|
redirect_to :action => "show_stats"
|
|
end
|
|
end
|