Add announcement admin and view template
This commit is contained in:
1 parent
4807066c68
commit
5570a2dfbf
12 files changed
+145
-115
No files matched your search
@@ -1,10 +1,22 @@
|
||||
# Filters added to this controller apply to all controllers in the application.
|
||||
# Likewise, all the methods added will be available for all controllers.
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
helper :all # include all helpers, all the time
|
||||
protect_from_forgery # See ActionController::RequestForgeryProtection for details
|
||||
|
||||
# Scrub sensitive parameters from your log
|
||||
# filter_parameter_logging :password
|
||||
helper :all
|
||||
protect_from_forgery
|
||||
|
||||
filter_parameter_logging :password
|
||||
|
||||
Liquid::Template.register_filter(SnippetFilter)
|
||||
|
||||
def render_liquid_page
|
||||
if @page
|
||||
@layout = @page.layout
|
||||
@page_options ||= {}
|
||||
@page_content = Liquid::Template.parse(@page.content).render(@page_options)
|
||||
@layout_content = (@page.layout)? @layout.content : "{{page_content}}"
|
||||
render :text => Liquid::Template.parse(@layout_content).render( 'page_content' => @page_content )
|
||||
else
|
||||
render :text => '404 Not Found'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user