Organizing misc pages

This commit is contained in:
magnolia-fan
2011-11-27 12:41:28 +04:00
parent 6fa215cb2a
commit 8cf69faf32
12 changed files with 39 additions and 24 deletions
+9 -18
View File
@@ -5,28 +5,19 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_locale
def index; end
def greetings
render partial: 'greetings'
end
def about
render partial: 'about'
end
def stat
@artists = Artist.count
@albums = Album.count
@tracks = Track.count
@users = User.count
render partial: 'stat'
end
def cache_for time
response.headers['Cache-Control'] = 'public, max-age=' + time.seconds.to_s
end
def compile_page params
@data = params[:data]
render json: {
status: (params[:status] unless params[:status].nil?),
data: @data,
html: render_compact_partial(params[:partial])
}, include: (params[:include] unless params[:include].nil?)
end
protected
def authorize
+21
View File
@@ -0,0 +1,21 @@
class PageController < ApplicationController
def index
# Something
end
def greetings
render partial: 'greetings'
end
def about
render partial: 'about'
end
def stat
@artists = Artist.count
@albums = Album.count
@tracks = Track.count
@users = User.count
render partial: 'stat'
end
end