Organizing misc pages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user