lib/support/route_mapper.rb
# For mounting a page to a path
For mounting a page to a path
For mounting a page to a path
def comatose_root( path, options={} )
    opts = {
      :index      => '',
      :layout     => 'comatose_content.html.erb',
      :use_cache  => 'true',
      :cache_path => nil,
      :named_route=> nil
    }.merge(options)
    Comatose.add_mount_point(path, opts)
    opts[:controller] = 'comatose'
    opts[:action] ='show'
    opts[:as] = opts.delete(:named_route)
		opts[:cache] = "true"
		opts[:request_method] = "get"
    if opts[:index] == '' 
      opts[:as] = "comatose_root"
      match( "/(*page)", opts )
    else
      match( "#{path}/*page", opts )
    end
   end
def comatose_root ( path , options = { } ) opts = { :index => '' , :layout => 'comatose_content.html.erb' , :use_cache => 'true' , :cache_path => nil , :named_route => nil } . merge ( options ) Comatose . add_mount_point ( path , opts ) opts [ :controller ] = 'comatose' opts [ :action ] = 'show' opts [ :as ] = opts . delete ( :named_route ) opts [ :cache ] = "true" opts [ :request_method ] = "get" if opts [ :index ] == '' opts [ :as ] = "comatose_root" match ( "/(*page)" , opts ) else match ( "#{path}/*page" , opts ) end end
For mounting a page to a path
For mounting a page to a path
# Ensure the controller is aware of the mount point... # Add the route... # if it maps to the root site URI, name it comatose_root #named_route( 'comatose_root', "#{path}/*page", opts ) #match( "#{path}/*page", opts, "compatose_rout" )
path
<not_specific>
options
<not_specific>