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

Changeset 2649

Show
Ignore:
Timestamp:
10/16/05 15:42:03 (3 years ago)
Author:
minam
Message:

Update/clean up AP documentation (rdoc)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r2638 r2649  
    11*SVN* 
     2 
     3* Update/clean up documentation (rdoc) 
    24 
    35* Upgrade to Prototype 1.4.0_rc0 [Sam Stephenson] 
  • trunk/actionpack/lib/action_controller/base.rb

    r2612 r2649  
    4747  #      
    4848  #     def sign 
    49   #       Entry.create(@params["entry"]) 
     49  #       Entry.create(params[:entry]) 
    5050  #       redirect_to :action => "index" 
    5151  #     end 
     
    8484  #   def hello_ip 
    8585  #     location = request.env["REMOTE_IP"] 
    86   #     render_text "Hello stranger from #{location}" 
     86  #     render :text => "Hello stranger from #{location}" 
    8787  #   end 
    8888  # 
  • trunk/actionpack/lib/action_controller/caching.rb

    r2544 r2649  
    351351      end 
    352352 
    353       module ThreadSafety 
     353      module ThreadSafety #:nodoc: 
    354354        def read(name, options=nil) #:nodoc: 
    355355          @mutex.synchronize { super } 
  • trunk/actionpack/lib/action_controller/flash.rb

    r1189 r2649  
    22  # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed 
    33  # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action 
    4   # that sets <tt>flash["notice"] = "Successfully created"</tt> before redirecting to a display action that can then expose  
     4  # that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can then expose  
    55  # the flash to its template. Actually, that exposure is automatically done. Example: 
    66  # 
     
    88  #     def create 
    99  #       # save post 
    10   #       flash["notice"] = "Successfully created post" 
    11   #       redirect_to :action => "display", :params => { "id" => post.id } 
     10  #       flash[:notice] = "Successfully created post" 
     11  #       redirect_to :action => "display", :params => { :id => post.id } 
    1212  #     end 
    1313  # 
     
    1818  # 
    1919  #   display.rhtml 
    20   #     <% if @flash["notice"] %><div class="notice"><%= @flash["notice"] %></div><% end %> 
     20  #     <% if @flash[:notice] %><div class="notice"><%= @flash[:notice] %></div><% end %> 
    2121  # 
    2222  # This example just places a string in the flash, but you can put any object in there. And of course, you can put as many 
     
    6868      # Sets a flash that will not be available to the next action, only to the current. 
    6969      # 
    70       #     flash.now["message"] = "Hello current action" 
     70      #     flash.now[:message] = "Hello current action" 
    7171      #  
    7272      # This method enables you to use the flash as a central messaging system in your app. 
     
    8383      # 
    8484      #    flash.keep            # keeps the entire flash 
    85       #    flash.keep("notice")  # keeps only the "notice" entry, the rest of the flash is discarded 
     85      #    flash.keep(:notice)   # keeps only the "notice" entry, the rest of the flash is discarded 
    8686      def keep(k=nil) 
    8787        use(k, false) 
     
    9191      # 
    9292      #     flash.keep                 # keep entire flash available for the next action 
    93       #     flash.discard('warning')   # discard the "warning" entry (it'll still be available for the current action) 
     93      #     flash.discard(:warning)    # discard the "warning" entry (it'll still be available for the current action) 
    9494      def discard(k=nil) 
    9595        use(k) 
  • trunk/actionpack/lib/action_controller/pagination.rb

    r2078 r2649  
    168168   
    169169    # Returns a collection of items for the given +model+ and +options[conditions]+, 
    170     # ordered by +options[order_by]+, for the current page in the given +paginator+. 
     170    # ordered by +options[order]+, for the current page in the given +paginator+. 
    171171    # Override this method to implement a custom finder. 
    172172    def find_collection_for_pagination(model, options, paginator) 
  • trunk/actionpack/lib/action_controller/request.rb

    r2596 r2649  
    131131    end 
    132132     
     133    # Returns the request URI correctly, taking into account the idiosyncracies 
     134    # of the various servers. 
    133135    def request_uri 
    134136      if uri = env['REQUEST_URI'] 
     
    217219    # Must be implemented in the concrete request 
    218220    #++ 
    219     def query_parameters 
    220     end 
    221  
    222     def request_parameters 
    223     end 
    224  
    225     def env 
    226     end 
    227  
    228     def host 
    229     end 
    230  
    231     def cookies 
    232     end 
    233  
    234     def session 
    235     end 
    236  
    237     def reset_session 
     221    def query_parameters #:nodoc: 
     222    end 
     223 
     224    def request_parameters #:nodoc: 
     225    end 
     226 
     227    def env #:nodoc: 
     228    end 
     229 
     230    def host #:nodoc: 
     231    end 
     232 
     233    def cookies #:nodoc: 
     234    end 
     235 
     236    def session #:nodoc: 
     237    end 
     238 
     239    def reset_session #:nodoc: 
    238240    end     
    239241  end 
  • trunk/actionpack/lib/action_controller/session_management.rb

    r2527 r2649  
    7878      end 
    7979 
    80       def cached_session_options 
     80      def cached_session_options #:nodoc: 
    8181        @session_options ||= read_inheritable_attribute("session_options") || [] 
    8282      end 
  • trunk/actionpack/lib/action_pack/version.rb

    r2514 r2649  
    11module ActionPack 
    2   module Version 
     2  module Version #:nodoc: 
    33    MAJOR = 1 
    44    MINOR = 9 
  • trunk/actionpack/lib/action_view/base.rb

    r2630 r2649  
    136136    @@template_handlers = {} 
    137137  
    138     module CompiledTemplates 
     138    module CompiledTemplates #:nodoc: 
    139139      # holds compiled template code 
    140140    end 
     
    163163    end 
    164164 
     165    # Register a class that knows how to handle template files with the given 
     166    # extension. This can be used to implement new template types. 
     167    # The constructor for the class must take the ActiveView::Base instance 
     168    # as a parameter, and the class must implement a #render method that 
     169    # takes the contents of the template to render as well as the Hash of 
     170    # local assigns available to the template. The #render method ought to 
     171    # return the rendered template as a string. 
    165172    def self.register_template_handler(extension, klass) 
    166173      @@template_handlers[extension] = klass 
  • trunk/actionpack/lib/action_view/helpers/text_helper.rb

    r2537 r2649  
    253253      end 
    254254 
    255       class Cycle 
     255      class Cycle #:nodoc: 
    256256        attr_reader :values 
    257257         
  • trunk/actionpack/README

    r1814 r2649  
    4141      def update 
    4242        @customer = find_customer 
    43         @customer.attributes = @params["customer"
     43        @customer.attributes = params[:customer
    4444        @customer.save ?  
    4545          redirect_to(:action => "display") :  
     
    4848       
    4949      private 
    50         def find_customer() Customer.find(@params["id"]) end 
     50        def find_customer() Customer.find(params[:id]) end 
    5151    end 
    5252 
     
    183183    def list 
    184184      @pages, @people = 
    185         paginate :people, :order_by => 'last_name, first_name' 
     185        paginate :people, :order => 'last_name, first_name' 
    186186    end 
    187187 
     
    203203 
    204204      def test_failing_authenticate 
    205         process :authenticate, "user_name" => "nop", "password" => "" 
    206         assert_flash_has 'alert' 
     205        process :authenticate, :user_name => "nop", :password => "" 
     206        assert flash.has_key?(:alert) 
    207207        assert_redirected_to :action => "index" 
    208208      end 
     
    253253       
    254254      def update 
    255         List.update(@params["list"]["id"], @params["list"]) 
    256         expire_page   :action => "show", :id => @params["list"]["id"
     255        List.update(params[:list][:id], params[:list]) 
     256        expire_page   :action => "show", :id => params[:list][:id
    257257        expire_action :action => "account" 
    258         redirect_to   :action => "show", :id => @params["list"]["id"
     258        redirect_to   :action => "show", :id => params[:list][:id
    259259      end 
    260260    end 
     
    343343    class WeblogController < ActionController::Base 
    344344      def save 
    345         post = Post.create(@params["post"]) 
    346         redirect_to :action => "display", :path_params => { "id" => post.id } 
     345        post = Post.create(params[:post]) 
     346        redirect_to :action => "display", :id => post.id 
    347347      end 
    348348    end 
     
    371371     
    372372    def display 
    373       @post = Post.find(@params["id"]) 
     373      @post = Post.find(:params[:id]) 
    374374    end 
    375375     
     
    379379     
    380380    def create 
    381       @post = Post.create(@params["post"]) 
     381      @post = Post.create(params[:post]) 
    382382      redirect_to :action => "display", :id => @post.id 
    383383    end