lib/support/route_mapper.rb
def comatose_root( path, options={} )
    opts = {
      :index      => '',
      :layout     => 'comatose_content.html.erb',
      :use_cache  => 'true',
      :cache_path => nil,
      :named_route=> nil
    }.merge(options)
    # Ensure the controller is aware of the mount point...
    Comatose.add_mount_point(path, opts)
    # Add the route...
    opts[:controller] = 'comatose'
    opts[:action] ='show'
    route_name = opts.delete(:named_route)
    unless route_name.nil?
      named_route( route_name, "#{path}/*page", opts )
    else
      if opts[:index] == '' # if it maps to the root site URI, name it comatose_root
        named_route( 'comatose_root', "#{path}/*page", opts )
      else
        connect( "#{path}/*page", opts )
      end
    end
  end
# 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'
    route_name = opts.delete(:named_route)
    unless route_name.nil?
      named_route( route_name, "#{path}/*page", opts )
    else
      if opts[:index] == '' 
        named_route( 'comatose_root', "#{path}/*page", opts )
      else
        connect( "#{path}/*page", opts )
      end
    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' route_name = opts . delete ( :named_route ) unless route_name . nil? named_route ( route_name , "#{path}/*page" , opts ) else if opts [ :index ] == '' named_route ( 'comatose_root' , "#{path}/*page" , opts ) else connect ( "#{path}/*page" , opts ) end 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
path
options