lib/scaffolding_extensions/controller/ramaze.rb
# Adds a default scaffolded layout if none has been set.  Activates the Erubis
# engine.  Includes the necessary scaffolding helper and controller methods.
Adds a default scaffolded layout if none has been set.  Activates the Erubis
engine.  Includes the necessary scaffolding helper and controller methods.
Adds a default scaffolded layout if none has been set . Activates the Erubis engine . Includes the necessary scaffolding helper and controller methods .
def scaffold_setup_helper
      engine :Erubis
      layout(:layout){|name, wish| !request.xhr? }
      setup
      o = options
      o.roots ||= []
      o.views ||= []
      o.layouts ||= []
      o.roots += [scaffold_template_dir] unless o.roots.include?(scaffold_template_dir)
      o.views << '/' unless o.views.include? '/'
      o.layouts << '/' unless o.layouts.include? '/'
      include ScaffoldingExtensions::Controller
      include ScaffoldingExtensions::RamazeController
      include ScaffoldingExtensions::Helper
    end
def scaffold_setup_helper engine :Erubis layout ( :layout ) { | name , wish | ! request . xhr? } setup o = options o . roots ||= [ ] o . views ||= [ ] o . layouts ||= [ ] o . roots += [ scaffold_template_dir ] unless o . roots . include? ( scaffold_template_dir ) o . views << '/' unless o . views . include? '/' o . layouts << '/' unless o . layouts . include? '/' include ScaffoldingExtensions :: Controller include ScaffoldingExtensions :: RamazeController include ScaffoldingExtensions :: Helper end
Adds a default scaffolded layout if none has been set.
Adds a default scaffolded layout if none has been set .
# Instantiates the controller's App (necessary to have a valid # Ramaze::Controller.options, which is actually just a shortcut # to controller's App options) # Retrieves current controller options, and ensure the required ones # are properly initialized # Adds scaffold_template_dir to the controller roots # The scaffolding_extensions templates are located directly in the # scaffold_template_dir, not in a view/ or layout/ subdirectory, # so adds '/' to the views et layout default search paths