Sha256: abe431b5b88f613ae7ac17dbabf105d55f2aca1a791223bbbe4e9b311d3d4875
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 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 Asset.include_css ["mcms_pages/layout"] end # end method end # end class
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mcms_pages-0.0.4 | app/controllers/admin/layouts_controller.rb |
mcms_pages-0.0.3 | app/controllers/admin/layouts_controller.rb |
mcms_pages-0.0.2 | app/controllers/admin/layouts_controller.rb |