Changeset 1228 for trunk/README

Show
Ignore:
Timestamp:
01/09/08 11:45:24 (11 months ago)
Author:
e.@brainspl.at
Message:

checking in server.rb refactor, split into config.rb boot_loader.rb, integrated Merb.root stuff. This will probably break a few small things and maybe some plugins but bear with me as this is a needed change. do not use Merb::Server.config[:foo] anymore, instead use Merb::Config[:foo], do not use MERB_ROOT anymore use Merb.root instead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README

    r1224 r1228  
    104104 
    105105To use your choice ORM, install the appropriate gem and uncomment the appropriate +use_orm+ line in 
    106 MERB_ROOT/config/dependencies.rb 
     106Merb.root/config/dependencies.rb 
    107107 
    108108=== Controllers 
    109109 
    110 (MERB_ROOT/app/controllers/*) 
     110(Merb.root/app/controllers/*) 
    111111 
    112112Merb controllers inherit from Merb::Controller and contain built in view/template rendering. 
     
    118118you are going to want to end your functions with a call to +render+.  By default, +render+ will 
    119119render the view template associated with your action (in default merb that would be  
    120 MERB_ROOT/app/views/<controller>/<action>.html.erb - see the View section for more info.) 
    121  
    122 Controllers can be generated by calling MERB_ROOT/script/generate controller ControllerName. 
    123 By default, generated controllers inherit from the Application class (MERB_ROOT/app/controllers/application.rb) 
     120Merb.root/app/views/<controller>/<action>.html.erb - see the View section for more info.) 
     121 
     122Controllers can be generated by calling Merb.root/script/generate controller ControllerName. 
     123By default, generated controllers inherit from the Application class (Merb.root/app/controllers/application.rb) 
    124124which itself inherits from Merb:Controller.  Application is a good place to put code pertinent to all controllers. 
    125125An example would be setting a filter to check if a user is logged in or to preload user data for each controller. 
     
    179179=== Views 
    180180 
    181 (MERB_ROOT/app/views/*) 
     181(Merb.root/app/views/*) 
    182182 
    183183A view can be loosely defined as any data sent back to the client (a "view" of your data.) 
     
    186186By default, a call to +render+ without any options renders the view template associated 
    187187with that controller action.  Using the default ERB templating system, this means that a 
    188 call to +render+ in Posts#index would render the file MERB_ROOT/app/views/posts/index.html.erb 
     188call to +render+ in Posts#index would render the file Merb.root/app/views/posts/index.html.erb 
    189189 
    190190==== Layouts 
    191191 
    192 (MERB_ROOT/app/views/layout/*) 
     192(Merb.root/app/views/layout/*) 
    193193 
    194194Layouts are generic templates in which your specific view templates are rendered.  A sample 
     
    206206 
    207207By default, +render+ will look for a corresponding layout for your controller in the form 
    208 of MERB_ROOT/app/views/layout/<controller>.html.erb .  If no specific layout is present, 
    209 +render+ will attempt to use MERB_ROOT/app/view/layout/application.html.erb 
     208of Merb.root/app/views/layout/<controller>.html.erb .  If no specific layout is present, 
     209+render+ will attempt to use Merb.root/app/view/layout/application.html.erb 
    210210 
    211211<i>See #render for more details/options, as well as how to use different templating systems 
     
    230230=== Helpers 
    231231 
    232 (MERB_ROOT/app/helpers/*) 
     232(Merb.root/app/helpers/*) 
    233233 
    234234app/helpers/global_helper.rb will be available to all of your views. 
     
    242242        def upload 
    243243          puts params[:file].inspect 
    244           FileUtils.mv params[:file][:tempfile].path, MERB_ROOT+"/uploads/#{params[:file][:filename]}" 
     244          FileUtils.mv params[:file][:tempfile].path, Merb.root+"/uploads/#{params[:file][:filename]}" 
    245245          render 
    246246        end