Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7517

Show
Ignore:
Timestamp:
09/20/07 23:16:06 (1 year ago)
Author:
david
Message:

Updated some docs to reference the latest and greatest and played style nazi a little

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/configs/initializers/mime_types.rb

    r6869 r7517  
    11# Add new mime types for use in respond_to blocks: 
    22# Mime::Type.register "text/richtext", :rtf 
    3 # Mime::Type.register "application/x-mobile", :mobil
     3# Mime::Type.register_alias "text/html", :iphon
  • trunk/railties/configs/routes.rb

    r6869 r7517  
    33 
    44  # Sample of regular route: 
    5   # map.connect 'products/:id', :controller => 'catalog', :action => 'view' 
     5  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view' 
    66  # Keep in mind you can assign values other than :controller and :action 
    77 
    88  # Sample of named route: 
    9   # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' 
     9  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' 
    1010  # This route can be invoked with purchase_url(:id => product.id) 
    1111 
    1212  # Sample resource route (maps HTTP verbs to controller actions automatically): 
    13   # map.resources :products 
     13  #   map.resources :products 
    1414 
    1515  # Sample resource route with options: 
    16   # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } 
     16  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } 
    1717 
    1818  # Sample resource route with sub-resources: 
    19   # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller 
     19  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller 
     20 
     21  # Sample resource route within a namespace: 
     22  #   map.namespace :admin do |admin| 
     23  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) 
     24  #     admin.resources :products 
     25  #   end 
    2026 
    2127  # You can have the root of your site routed with map.root -- just remember to delete public/index.html. 
    2228  # map.root :controller => "welcome" 
     29 
     30  # See how all your routes lay out with "rake routes" 
    2331 
    2432  # Install the default routes as the lowest priority. 
  • trunk/railties/html/robots.txt

    r1876 r7517  
    11# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 
     2# 
     3# To ban all spiders from the entire site uncomment the next two lines: 
     4# User-Agent: * 
     5# Disallow: / 
  • trunk/railties/lib/rails_generator/generators/components/migration/migration_generator.rb

    r7422 r7517  
    55    end 
    66  end 
     7 
    78   
    8   private 
    9    
    10   def get_local_assigns 
    11     returning(assigns = {}) do 
    12       if class_name.underscore =~ /^(add|remove)_.*_(?:to|from)_(.*)/ 
    13         assigns[:migration_action] = $1 
    14         assigns[:table_name]       = $2.pluraliz
    15       else 
    16         assigns[:attributes] = [] 
     9  private   
     10    def get_local_assigns 
     11      returning(assigns = {}) do 
     12        if class_name.underscore =~ /^(add|remove)_.*_(?:to|from)_(.*)/ 
     13          assigns[:migration_action] = $1 
     14          assigns[:table_name]       = $2.pluralize 
     15        els
     16          assigns[:attributes] = [] 
     17        end 
    1718      end 
    1819    end 
    19   end 
    2020end