Changeset 2649
- Timestamp:
- 10/16/05 15:42:03 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/base.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/caching.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/flash.rb (modified) (6 diffs)
- trunk/actionpack/lib/action_controller/pagination.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/request.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/session_management.rb (modified) (1 diff)
- trunk/actionpack/lib/action_pack/version.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/base.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_view/helpers/text_helper.rb (modified) (1 diff)
- trunk/actionpack/README (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r2638 r2649 1 1 *SVN* 2 3 * Update/clean up documentation (rdoc) 2 4 3 5 * Upgrade to Prototype 1.4.0_rc0 [Sam Stephenson] trunk/actionpack/lib/action_controller/base.rb
r2612 r2649 47 47 # 48 48 # def sign 49 # Entry.create( @params["entry"])49 # Entry.create(params[:entry]) 50 50 # redirect_to :action => "index" 51 51 # end … … 84 84 # def hello_ip 85 85 # location = request.env["REMOTE_IP"] 86 # render _text"Hello stranger from #{location}"86 # render :text => "Hello stranger from #{location}" 87 87 # end 88 88 # trunk/actionpack/lib/action_controller/caching.rb
r2544 r2649 351 351 end 352 352 353 module ThreadSafety 353 module ThreadSafety #:nodoc: 354 354 def read(name, options=nil) #:nodoc: 355 355 @mutex.synchronize { super } trunk/actionpack/lib/action_controller/flash.rb
r1189 r2649 2 2 # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed 3 3 # 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 expose4 # that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can then expose 5 5 # the flash to its template. Actually, that exposure is automatically done. Example: 6 6 # … … 8 8 # def create 9 9 # # 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 } 12 12 # end 13 13 # … … 18 18 # 19 19 # display.rhtml 20 # <% if @flash[ "notice"] %><div class="notice"><%= @flash["notice"] %></div><% end %>20 # <% if @flash[:notice] %><div class="notice"><%= @flash[:notice] %></div><% end %> 21 21 # 22 22 # 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 … … 68 68 # Sets a flash that will not be available to the next action, only to the current. 69 69 # 70 # flash.now[ "message"] = "Hello current action"70 # flash.now[:message] = "Hello current action" 71 71 # 72 72 # This method enables you to use the flash as a central messaging system in your app. … … 83 83 # 84 84 # flash.keep # keeps the entire flash 85 # flash.keep( "notice")# keeps only the "notice" entry, the rest of the flash is discarded85 # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded 86 86 def keep(k=nil) 87 87 use(k, false) … … 91 91 # 92 92 # 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) 94 94 def discard(k=nil) 95 95 use(k) trunk/actionpack/lib/action_controller/pagination.rb
r2078 r2649 168 168 169 169 # 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+. 171 171 # Override this method to implement a custom finder. 172 172 def find_collection_for_pagination(model, options, paginator) trunk/actionpack/lib/action_controller/request.rb
r2596 r2649 131 131 end 132 132 133 # Returns the request URI correctly, taking into account the idiosyncracies 134 # of the various servers. 133 135 def request_uri 134 136 if uri = env['REQUEST_URI'] … … 217 219 # Must be implemented in the concrete request 218 220 #++ 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: 238 240 end 239 241 end trunk/actionpack/lib/action_controller/session_management.rb
r2527 r2649 78 78 end 79 79 80 def cached_session_options 80 def cached_session_options #:nodoc: 81 81 @session_options ||= read_inheritable_attribute("session_options") || [] 82 82 end trunk/actionpack/lib/action_pack/version.rb
r2514 r2649 1 1 module ActionPack 2 module Version 2 module Version #:nodoc: 3 3 MAJOR = 1 4 4 MINOR = 9 trunk/actionpack/lib/action_view/base.rb
r2630 r2649 136 136 @@template_handlers = {} 137 137 138 module CompiledTemplates 138 module CompiledTemplates #:nodoc: 139 139 # holds compiled template code 140 140 end … … 163 163 end 164 164 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. 165 172 def self.register_template_handler(extension, klass) 166 173 @@template_handlers[extension] = klass trunk/actionpack/lib/action_view/helpers/text_helper.rb
r2537 r2649 253 253 end 254 254 255 class Cycle 255 class Cycle #:nodoc: 256 256 attr_reader :values 257 257 trunk/actionpack/README
r1814 r2649 41 41 def update 42 42 @customer = find_customer 43 @customer.attributes = @params["customer"]43 @customer.attributes = params[:customer] 44 44 @customer.save ? 45 45 redirect_to(:action => "display") : … … 48 48 49 49 private 50 def find_customer() Customer.find( @params["id"]) end50 def find_customer() Customer.find(params[:id]) end 51 51 end 52 52 … … 183 183 def list 184 184 @pages, @people = 185 paginate :people, :order _by=> 'last_name, first_name'185 paginate :people, :order => 'last_name, first_name' 186 186 end 187 187 … … 203 203 204 204 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) 207 207 assert_redirected_to :action => "index" 208 208 end … … 253 253 254 254 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] 257 257 expire_action :action => "account" 258 redirect_to :action => "show", :id => @params["list"]["id"]258 redirect_to :action => "show", :id => params[:list][:id] 259 259 end 260 260 end … … 343 343 class WeblogController < ActionController::Base 344 344 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 347 347 end 348 348 end … … 371 371 372 372 def display 373 @post = Post.find( @params["id"])373 @post = Post.find(:params[:id]) 374 374 end 375 375 … … 379 379 380 380 def create 381 @post = Post.create( @params["post"])381 @post = Post.create(params[:post]) 382 382 redirect_to :action => "display", :id => @post.id 383 383 end