Sha256: 77899d4390b694aa2a5968228072daaec2c2af19db796ffdc3b06a68d8b54107
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
=begin @File Name : admin/layouts_controller.rb @Company Name : Mindfire Solutions Private Limited @Creator Name : Vikram Kumar Mishra @Date Created : 2012-06-15 @Date Modified : @Last Modification Details : @Purpose : To setup the communication between layout model and views related to layouts under namespace admin. =end class Admin::LayoutsController < AdminController before_filter :load_assets # GET /layouts # GET /layouts.json # To find all layouts and display it to the user to choose one def index # find all layouts @layouts = Layout.all # find parent_id of page if child page is being created # if parent_id is not there i.e. child page is not being created, # use parent_id as 0 @page_parent_id = (params[:parent_id]) ? params[:parent_id] : 0 # send data in different format respond_to do |format| format.html{render :template => 'mcms_pages/admin/layouts/index'}# index.html.erb format.json { render json: @pages } end # end respond_to end # end action #defining controller specific method as protected protected #calling library class AssetManager's methods to include specific js and css files def load_assets # class method call to include css files AssetManager.include_css ["mcms_pages/layout"] end # end method end # end class
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mcms_pages-0.0.1 | app/controllers/admin/layouts_controller.rb |