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

root/tags/rel_0-11-0/actionpack/CHANGELOG

Revision 974, 56.7 kB (checked in by david, 4 years ago)

Added documentation and fixed an ajax bug

Line 
1 *1.6.0* (22th March, 2005)
2
3 * Added a JavascriptHelper and accompanying prototype.js library that opens the world of Ajax to Action Pack with a large array of options for dynamically interacting with an application without reloading the page #884 [Sam Stephenson/David]
4
5 * Added pagination support through both a controller and helper add-on #817 [Sam Stephenson]
6
7 * Fixed routing and helpers to make Rails work on non-vhost setups #826 [Nicholas Seckar/Tobias Luetke]
8
9 * Added a much improved Flash module that allows for finer-grained control on expiration and allows you to flash the current action #839 [Caio Chassot]. Example of flash.now:
10
11     class SomethingController < ApplicationController
12       def save
13         ...
14         if @something.save
15           # will redirect, use flash
16           flash[:message] = 'Save successful'
17           redirect_to :action => 'list'
18         else
19           # no redirect, message is for current action, use flash.now
20           flash.now[:message] = 'Save failed, review'
21           render_action 'edit'
22         end
23       end   
24     end
25
26 * Added to_param call for parameters when composing an url using url_for from something else than strings #812 [Sam Stephenson]. Example:
27
28     class Page
29       def initialize(number)
30         @number = number
31       end
32       # ...
33       def to_param
34         @number.to_s
35       end
36     end
37
38   You can now use instances of Page with url_for:
39
40     class BarController < ApplicationController
41       def baz
42         page = Page.new(4)
43         url = url_for :page => page # => "http://foo/bar/baz?page=4"
44       end
45     end
46
47 * Fixed form helpers to query Model#id_before_type_cast instead of Model#id as a temporary workaround for Ruby 1.8.2 warnings #818 [DeLynn B]
48
49 * Fixed TextHelper#markdown to use blank? instead of empty? so it can deal with nil strings passed #814 [Johan Sörensen]
50
51 * Added TextHelper#simple_format as a non-dependency text presentation helper #814 [Johan Sörensen]
52
53 * Added that the html options disabled, readonly, and multiple can all be treated as booleans. So specifying <tt>disabled => :true</tt> will give <tt>disabled="disabled"</tt>. #809 [mindel]
54
55 * Added path collection syntax for Routes that will gobble up the rest of the url and pass it on to the controller #830 [rayners]. Example:
56
57     map.connect 'categories/*path_info', :controller => 'categories', :action => 'show'
58
59   A request for /categories/top-level-cat, would give @params[:path_info] with "top-level-cat".
60   A request for /categories/top-level-cat/level-1-cat, would give @params[:path_info] with "top-level-cat/level-1-cat" and so forth.
61  
62   The @params[:path_info] return is really an array, but where to_s has been overwritten to do join("/").
63
64 * Fixed options_for_select on selected line issue #624 [Florian Weber]
65
66 * Added CaptureHelper with CaptureHelper#capture and CaptureHelper#content_for. See documentation in helper #837 [Tobias Luetke]
67
68 * Fixed :anchor use in url_for #821 [Nicholas Seckar]
69
70 * Removed the reliance on PATH_INFO as it was causing problems for caching and inhibited the new non-vhost support #822 [Nicholas Seckar]
71
72 * Added assigns shortcut for @response.template.assigns to controller test cases [bitsweat]. Example:
73
74   Before:
75
76     def test_list
77       assert_equal 5, @response.template.assigns['recipes'].size
78       assert_equal 8, @response.template.assigns['categories'].size
79     end
80
81   After:
82
83     def test_list
84       assert_equal 5, assigns(:recipes).size
85       assert_equal 8, assigns(:categories).size
86     end
87
88 * Added TagHelper#image_tag and deprecated UrlHelper#link_image_to (recommended approach is to combine image_tag and link_to instead)
89
90 * Fixed textilize to be resilient to getting nil parsed (by using Object#blank? instead of String#empty?)
91
92 * Fixed that the :multipart option in FormTagHelper#form_tag would be ignored [Yonatan Feldman]
93
94
95 *1.5.1* (7th March, 2005)
96
97 * Fixed that the routes.rb file wouldn't be found on symlinked setups due to File.expand_path #793 [piotr@t-p-l.com]
98
99 * Changed ActiveRecordStore to use Marshal instead of YAML as the latter proved troublesome in persisting circular dependencies. Updating existing applications MUST clear their existing session table from data to start using this updated store #739 [Jamis Buck]
100
101 * Added shortcut :id assignment to render_component and friends (before you had to go through :params) #784 [Lucas Carlson]
102
103 * Fixed that map.connect should convert arguments to strings #780 [Nicholas Seckar]
104
105 * Added UrlHelper#link_to_if/link_to_unless to enable other conditions that just link_to_unless_current #757 [mindel]
106
107 * Fixed that single quote was not escaped in a UrlHelper#link_to javascript confirm #549 [Scott Barron]
108
109 * Removed the default border on link_image_to (it broke xhtml strict) -- can be specified with :border => 0 #517 [?/caleb]
110
111 * Fixed that form helpers would treat string and symbol keys differently in html_options (and possibly create duplicate entries) #112 [bitsweat]
112
113 * Fixed that broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process
114
115 * Added the original exception message to session recall errors (so you can see which class wasnt required)
116
117 * Fixed that RAILS_ROOT might not be defined when AP was loaded, so do a late initialization of the ROUTE_FILE #761 [Scott Barron]
118
119 * Fix request.path_info and clear up LoadingModule behavior #754 [Nicholas Seckar]
120
121 * Fixed caching to be aware of extensions (so you can cache files like api.wsdl or logo.png) #734 [Nicholas Seckar]
122
123 * Fixed that Routes would raise NameErrors if a controller component contains characters that are not valid constant names #733 [Nicholas Seckar]
124
125 * Added PATH_INFO access from the request that allows urls like the following to be interpreted by rails: http://www.example.com/dispatcher.cgi/controller/action -- that makes it possible to use rails as a CGI under lighttpd and would also allow (for example) Rublog to be ported to rails without breaking existing links to Rublog-powered blogs. #728 [Jamis Buck]
126
127 * Fixed that caching the root would result in .html not index.html #731, #734 [alisdair/Nicholas Seckar]
128
129
130 *1.5.0* (24th February, 2005)
131
132 * Added Routing as a replacement for mod_rewrite pretty urls [Nicholas Seckar]. Read more in ActionController::Base.url_for and on http://manuals.rubyonrails.com/read/book/9
133
134 * Added components that allows you to call other actions for their rendered response while execution another action. You can either delegate the entire response rendering or you can mix a partial response in with your other content. Read more on http://manuals.rubyonrails.com/read/book/14
135
136 * Fixed that proxy IPs do not follow all RFC1918 nets #251 [caleb@aei-tech.com]
137
138 * Added Base#render_to_string to parse a template and get the result back as a string #479
139
140 * Fixed that send_file/data can work even if render* has been called before in action processing to render the content of a file to be send for example #601
141
142 * Added FormOptionsHelper#time_zone_select and FormOptionsHelper#time_zone_options_for_select to work with the new value object TimeZone in Active Support #688 [Jamis Buck]
143
144 * Added FormHelper#file_field and FormTagHelper#file_field_tag for creating file upload fields
145
146 * Added :order option for date_select that allows control over the order in which the date dropdowns is used and which of them should be used #619 [Tim Bates]. Examples:
147
148     date_select("post", "written_on", :order => [:day, :month, :year])
149     date_select("user", "birthday",   :order => [:month, :day])
150
151 * Added ActionView::Base.register_template_handler for easy integration of an alternative template language to ERb and Builder. See test/controller/custom_handler_test.rb for a usage example #656 [Jamis Buck]
152
153 * Added AssetTagHelper that provides methods for linking a HTML page together with other assets, such as javascripts, stylesheets, and feeds.
154
155 * Added FormTagHelper that provides a number of methods for creating form tags that doesn't rely on conventions with an object assigned to the template like FormHelper does. With the FormTagHelper, you provide the names and values yourself.
156
157 * Added Afghanistan, Iran, and Irak to the countries list used by FormOptions#country_select and FormOptions#country_options_for_select
158
159 * Renamed link_to_image to link_image_to (since thats what it actually does) -- kept alias for the old method name
160
161 * Fixed textilize for RedCloth3 to keep doing hardbreaks
162
163 * Fixed that assert_template_xpath_matches did not indicate when a path was not found #658 [Eric Hodel]
164
165 * Added TextHelper#auto_link to turn email addresses and urls into ahrefs
166
167 * Fixed that on validation errors, scaffold couldn't find template #654 [mindel]
168
169 * Added Base#hide_action(*names) to hide public methods from a controller that would otherwise have been callable through the URL. For the majority of cases, its preferred just to make the methods you don't want to expose protected or private (so they'll automatically be hidden) -- but if you must have a public method, this is a way to make it uncallable. Base#hidden_actions retrieve the list of all hidden actions for the controller #644 [Nicholas Seckar]
170
171 * Fixed that a bunch of methods from ActionController::Base was accessible as actions (callable through a URL) when they shouldn't have been #644 [Nicholas Seckar]
172
173 * Added UrlHelper#current_page?(options) method to check if the url_for options passed corresponds to the current page
174
175 * Fixed https handling on other ports than 443 [Alan Gano]
176
177 * Added follow_redirect method for functional tests that'll get-request the redirect that was made. Example:
178
179     def test_create_post
180       post :create, "post" => { "title" => "Exciting!" }
181       assert_redirected_to :action => "show"
182      
183       follow_redirect
184       assert_rendered_file "post/show"
185     end
186  
187   Limitation: Only works for redirects to other actions within the same controller.
188
189 * Fixed double requiring of models with the same name as the controller
190
191 * Fixed that query params could be forced to nil on a POST due to the raw post fix #562 [moriq@moriq.com]
192
193 * Fixed that cookies shouldn't be frozen in TestRequest #571 [Eric Hodel]
194
195
196 *1.4.0* (January 25th, 2005)
197
198 * Fixed problems with ActiveRecordStore under the development environment in Rails
199
200 * Fixed the ordering of attributes in the xml-decleration of Builder #540 [woeye]
201
202 * Added @request.raw_post as a convenience access to @request.env['RAW_POST_DATA'] #534 [Tobias Luetke]
203
204 * Added support for automatic id-based indexing for lists of items #532 [dblack]. Example:
205
206     <% @students.each do |@student| %>
207       <%= text_field "student[]", "first_name", :size => "20" %>
208       <%= text_field "student[]", "last_name" %>
209       <%= text_field "student[]", "grade", :size => "5" %>
210     <% end %>
211  
212   ...would produce, for say David Black with id 123 and a grace of C+:
213  
214     <input id="student_123_first_name" name="student[123][first_name]" size="20"     size="30" type="text" value="David" />
215     <input id="student_123_last_name" name="student[123][last_name]" size="30"  type="text" value="Black" />
216     <input id="student_123_grade" name="student[123][grade]" size="5" type="text"  value="C+" />
217
218 * Added :application_prefix to url_for and friends that makes it easier to setup Rails in non-vhost environments #516 [Jamis Buck]
219
220 * Added :encode option to mail_to that'll allow you to masquarede the email address behind javascript or hex encoding #494 [Lucas Carlson]
221
222 * Fixed that the content-header was being set to application/octet_stream instead of application/octet-stream on send_date/file [Alexey]
223
224 * Removed the need for passing the binding when using CacheHelper#cache
225
226 * Added TestResponse#binary_content that'll return as a string the data sent through send_data/send_file for testing #500 [Alexey]
227
228 * Added @request.env['RAW_POST_DATA'] for people who need access to the data before Ruby's CGI has parsed it #505 [bitsweat]
229
230 * Fixed that a default fragment store wan't being set to MemoryStore as intended.
231
232 * Fixed that all redirect and render calls now return true, so you can use the pattern of "do and return". Example:
233
234     def show
235       redirect_to(:action => "login") and return unless @person.authenticated?
236       render_text "I won't happen unless the person is authenticated"
237     end
238
239 * Added that renders and redirects called in before_filters will have the same effect as returning false: stopping the chain. Example:
240
241     class WeblogController
242       before_filter { |c| c.send(:redirect_to_url("http://www.farfaraway.com")}) }
243      
244       def hello
245         render_text "I will never be called"
246       end
247     end
248
249
250 * Added that only one render or redirect can happen per action. The first call wins and subsequent calls are ignored. Example:
251
252     def do_something
253       redirect_to :action => "elsewhere"
254       render_action "overthere"
255     end
256  
257   Only the redirect happens. The rendering call is simply ignored.
258
259
260 *1.3.1* (January 18th, 2005)
261
262 * Fixed a bug where cookies wouldn't be set if a symbol was used instead of a string as the key
263
264 * Added assert_cookie_equal to assert the contents of a named cookie
265
266 * Fixed bug in page caching that prevented it from working at all
267
268
269 *1.3.0* (January 17th, 2005)
270
271 * Added an extensive caching module that offers three levels of granularity (page, action, fragment) and a variety of stores.
272   Read more in ActionController::Caching.
273
274 * Added the option of passing a block to ActiveRecordHelper#form in order to add more to the auto-generated form #469 [dom@sisna.com]
275
276     form("entry", :action => "sign") do |form|
277       form << content_tag("b", "Department")
278       form << collection_select("department", "id", @departments, "id", "name")
279     end
280
281 * Added arrays as a value option for params in url_for and friends #467 [Eric Anderson]. Example:
282
283     url_for(:controller => 'user', :action => 'delete', :params => { 'username' =>  %( paul john steve ) } )
284     # => /user/delete?username[]=paul&username[]=john&username[]=steve
285
286 * Fixed that controller tests can now assert on the use of cookies #466 [Alexey]
287
288 * Fixed that send_file would "remember" all the files sent by adding to the headers again and again #458 [bitsweat]
289
290 * Fixed url rewriter confusion when the controller or action name was a substring of the controller_prefix or action_prefix
291
292 * Added conditional layouts like <tt>layout "weblog_standard", :except => :rss</tt> #452 [Marcel Molina]
293
294 * Fixed that MemCacheStore wasn't included by default and added default MemCache object pointing to localhost #447 [Lucas Carlson]
295
296 * Added fourth argument to render_collection_of_partials that allows you to specify local_assigns -- just like render_partial #432 [zenspider]
297
298 * Fixed that host would choke when cgi.host returned nil #432 [Tobias Luetke]
299
300 * Added that form helpers now take an index option #448 [Tim Bates]
301
302   Example:
303     text_field "person", "name", "index" => 3
304
305   Becomes:
306     <input type="text" name="person[3][name]" id="person_3_name" value="<%= @person.name %>" />
307
308 * Fixed three issues with retrying breakpoints #417 [Florian Gross]
309
310   1. Don't screw up pages that use multiple values for the same parameter (?foo=bar&foo=qux was converted to ?foo=barqux)
311   2. Don't screw up all forms when you click the "Retry with Breakpoint" link multiple times instead of reloading
312      (This caused the parameters to be added multiple times for GET forms leading to trouble.)
313   3. Don't add ?BP-RETRY=1 multiple times
314
315 * Added that all renders and redirects now return false, so they can be used as the last line in before_filters to stop execution.
316
317   Before:
318     def authenticate
319       unless @session[:authenticated]
320         redirect_to :controller => "account", :action => "login"
321         return false
322       end
323     end
324  
325   After:
326     def authenticate
327       redirect_to(:controller => "account", :action => "login") unless @session[:authenticated]
328     end
329
330 * Added conditional filters #431 [Marcel]. Example:
331
332     class JournalController < ActionController::Base
333       # only require authentication if the current action is edit or delete
334       before_filter :authorize, :only_on => [ :edit, :delete ]
335    
336       private
337         def authorize
338           # redirect to login unless authenticated
339         end
340     end
341
342 * Added Base#render_nothing as a cleaner way of doing render_text "" when you're not interested in returning anything but an empty response.
343
344 * Added the possibility of passing nil to UrlHelper#link_to to use the link itself as the name
345
346
347 *1.2.0* (January 4th, 2005)
348
349 * Added MemCacheStore for storing session data in Danga's MemCache system [Bob Cottrell]
350   Depends on: MemCached server (http://www.danga.com/memcached/), MemCache client (http://raa.ruby-lang.org/project/memcache/)
351
352 * Added thread-safety to the DRbStore #66, #389 [Ben Stiglitz]
353
354 * Added DateHelper#select_time and DateHelper#select_second #373 [Scott Baron]
355
356 * Added :host and :protocol options to url_for and friends to redirect to another host and protocol than the current.
357
358 * Added class declaration for the MissingFile exception #388 [Kent Sibilev]
359
360 * Added "short hypertext note with a hyperlink to the new URI(s)" to redirects to fulfill compliance with RFC 2616 (HTTP/1.1) section 10.3.3 #397 [Tim Bates]
361
362 * Added second boolean parameter to Base.redirect_to_url and Response#redirect to control whether the redirect is permanent or not (301 vs 302) #375 [Hodel]
363
364 * Fixed redirects when the controller and action is named the same. Still haven't fixed same controller, module, and action, though #201 [Josh]
365
366 * Fixed problems with running multiple functional tests in Rails under 1.8.2 by including hack for test/unit weirdness
367
368 * Fixed that @request.remote_ip didn't work in the test environment #369 [Bruno Mattarollo]
369
370
371 *1.1.0*
372
373 * Added search through session to clear out association caches at the end of each request. This makes it possible to place Active Record objects
374   in the session without worrying about stale data in the associations (the main object is still subject to caching, naturally) #347 [Tobias Luetke]
375
376 * Added more informative exception when using helper :some_helper and the helper requires another file that fails, you'll get an
377   error message tells you what file actually failed to load, rather than falling back on assuming it was the helper file itself #346 [dblack]
378
379 * Added use of *_before_type_cast for all input and text fields. This is helpful for getting "100,000" back on a integer-based
380   validation where the value would normally be "100".
381
382 * Added Request#port_string to get something like ":8080" back on 8080 and "" on 80 (or 443 with https).
383
384 * Added Request#domain (returns string) and Request#subdomains (returns array).
385
386 * Added POST support for the breakpoint retries, so form processing that raises an exception can be retried with the original request [Florian Gross]
387
388 * Fixed regression with Base#reset_session that wouldn't use the the DEFAULT_SESSION_OPTIONS [adam@the-kramers.net]
389
390 * Fixed error rendering of rxml documents to not just swallow the exception and return 0 (still not guessing the right line, but hey)
391
392 * Fixed that textilize and markdown would instantiate their engines even on empty strings. This also fixes #333 [Ulysses]
393
394 * Fixed UrlHelper#link_to_unless so it doesn't care if the id is a string or fixnum [zenspider]
395
396
397 *1.0.1*
398
399 * Fixed a bug that would cause an ApplicationController to require itself three times and hence cause filters to be run three times [evl]
400
401
402 *1.0*
403
404 * Added that controllers will now attempt to require a model dependency with their name and in a singular attempt for their name.
405   So both PostController and PostsController will automatically have the post.rb model required. If no model is found, no error is raised,
406   as it is then expected that no match is available and the programmer will have included his own models.
407
408 * Fixed DateHelper#date_select so that you can pass include_blank as an option even if you don't use start_year and end_year #59 [what-a-day]
409
410 * Added that controllers will now search for a layout in $template_root/layouts/$controller_name.r(html|xml), so PostsController will look
411   for layouts/posts.rhtml or layouts/posts.rxml and automatically configure this layout if found #307 [Marcel]
412
413 * Added FormHelper#radio_button to work with radio buttons like its already possible with check boxes [Michael Koziarski]
414
415 * Added TemplateError#backtrace that makes it much easier to debug template errors from unit and functional tests
416
417 * Added display of error messages with scaffolded form pages
418
419 * Added option to ERB templates to swallow newlines by using <% if something -%> instead of just <% if something %>. Example:
420
421     class SomeController < ApplicationController
422     <% if options[:scaffold] %>
423       scaffold :<%= singular_name %>
424     <% end %>
425       helper :post
426  
427   ...produces this on post as singular_name:
428
429     class SomeController < ApplicationController
430    
431       scaffold :post
432    
433       helper :post
434  
435   ...where as:
436
437     class SomeController < ApplicationController
438     <% if options[:scaffold] -%>
439       scaffold :<%= singular_name %>
440     <% end -%>
441       helper :post
442  
443   ...produces:
444
445     class SomeController < ApplicationController
446       scaffold :post
447       helper :post
448  
449   [This undocumented gem for ERb was uncovered by bitsweat]
450
451 * Fixed CgiRequest so that it'll now accept session options with Symbols as keys (as the documentation points out) [Suggested by Andreas]
452
453 * Added that render_partial will always by default include a counter with value 1 unless there is a counter passed in via the
454   local_assigns hash that overrides it. As a result, render_collection_of_partials can still be written in terms of render_partial
455   and partials that make use of a counter can be called without problems from both render_collection_of_partials as well as
456   render_partial #295 [marcel]
457
458 * Fixed CgiRequest#out to fall back to #write if $stdout doesn't have #syswrite [bitsweat]
459
460 * Fixed all helpers so that they use XHTML compliant double quotes for values instead of single quotes [htonl/bitsweat]
461
462 * Added link_to_image(src, options = {}, html_options = {}, *parameters_for_method_reference). Documentation:
463
464     Creates a link tag to the image residing at the +src+ using an URL created by the set of +options+. See the valid options in
465     link:classes/ActionController/Base.html#M000021. It's also possible to pass a string instead of an options hash to
466     get a link tag that just points without consideration. The <tt>html_options</tt> works jointly for the image and ahref tag by
467     letting the following special values enter the options on the image and the rest goes to the ahref:
468    
469     ::alt: If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
470     ::size: Supplied as "XxY", so "30x45" becomes width="30" and height="45"
471     ::align: Sets the alignment, no special features
472    
473     The +src+ can be supplied as a...
474     * full path, like "/my_images/image.gif"
475     * file name, like "rss.gif", that gets expanded to "/images/rss.gif"
476     * file name without extension, like "logo", that gets expanded to "/images/logo.png"
477
478 * Fixed to_input_field_tag so it no longer explicitly uses InstanceTag.value if value was specified in the options hash [evl]
479
480 * Added the possibility of having validate be protected for assert_(in)valid_column #263 [Tobias Luetke]
481
482 * Added that ActiveRecordHelper#form now calls url_for on the :action option.
483
484 * Added all the HTTP methods as alternatives to the generic "process" for functional testing #276 [Tobias Luetke]. Examples:
485
486     # Calls Controller#miletone with a GET request
487     process :milestone
488    
489     # Calls Controller#miletone with a POST request that has parameters
490     post :milestone, { "name" => "David" }
491    
492     # Calls Controller#milestone with a HEAD request that has both parameters and session data
493     head :milestone, { "id" => 1 }, { "user_id" => 23 }
494
495   This is especially useful for testing idiomatic REST web services.
496
497 * Added proper handling of HEAD requests, so that content isn't returned (Request#head? added as well) #277 [Eric Hodel]
498
499 * Added indifference to whether @headers["Content-Type"], @headers["Content-type"], or @headers["content-type"] is used.
500
501 * Added TestSession#session_id that returns an empty string to make it easier to functional test applications that doesn't use
502   cookie-based sessions #275 [jcf]
503
504 * Fixed that cached template loading would still check the file system to see if the file existed #258 [Andreas Schwarz]
505
506 * Added options to tailor header tag, div id, and div class on ActiveRecordHelper#error_messages_for [josh]
507
508 * Added graceful handling of non-alphanumeric names and misplaced brackets in input parameters [bitsweat]
509
510 * Added a new container for cookies that makes them more intuative to use. The old methods of cookie and @cookies have been deprecated.
511
512   Examples for writing:
513
514     cookies["user_name"] = "david" # => Will set a simple session cookie
515     cookies["login"] = { "value" => "XJ-122", "expires" => Time.now + 360} # => Will set a cookie that expires in 1 hour
516    
517   Examples for reading:
518  
519     cookies["user_name"] # => "david"
520     cookies.size         # => 2
521
522   Read more in ActionController::Cookies
523
524   NOTE: If you were using the old accessor (cookies instead of @cookies), this could potentially break your code -- if you expect a full cookie object!
525
526 * Added the opportunity to defined method_missing on a controller which will handle all requests for actions not otherwise defined #223 [timb]
527
528 * Fixed AbstractRequest#remote_ip for users going through proxies - Patch #228 [Eric Hodel]
529
530 * Added Request#ssl? which is shorthand for @request.protocol == "https://"
531
532 * Added the choice to call form_tag with no arguments (resulting in a form posting to current action) [bitsweat]
533
534 * Upgraded to Builder 1.2.1
535
536 * Added :module as an alias for :controller_prefix to url_for and friends, so you can do redirect_to(:module => "shop", :controller => "purchases")
537   and go to /shop/purchases/
538
539 * Added support for controllers in modules through @params["module"].
540
541 * Added reloading for dependencies under cached environments like FastCGI and mod_ruby. This makes it possible to use those environments for development.
542   This is turned on by default, but can be turned off with ActionController::Base.reload_dependencies = false in production environments.
543
544   NOTE: This will only have an effect if you use the new model, service, and observer class methods to mark dependencies. All libraries loaded through
545   require will be "forever" cached. You can, however, use ActionController::Base.load_or_require("library") to get this behavior outside of the new
546   dependency style.
547
548 * Added that controllers will automatically require their own helper if possible. So instead of doing:
549
550     class MsgController < ApplicationController
551       helper :msg
552     end
553    
554   ...you can just do:
555  
556     class MsgController < ApplicationController
557     end
558
559 * Added dependencies_on(layer) to query the dependencies of a controller. Examples:
560  
561     MsgController.dependencies_on(:model)    # => [ :post, :comment, :attachment ]
562     MsgController.dependencies_on(:service)  # => [ :notification_service ]
563     MsgController.dependencies_on(:observer) # => [ :comment_observer ]
564
565 * Added a new dependency model with the class methods model, service, and observer. Example:
566
567     class MsgController < ApplicationController
568       model    :post, :comment, :attachment
569       service  :notification_service
570       observer :comment_observer
571     end
572
573   These new "keywords" remove the need for explicitly calling 'require' in most cases. The observer method even instantiates the
574   observer as well as requiring it.
575
576 * Fixed that link_to would escape & in the url again after url_for already had done so
577
578
579 *0.9.5* (28)
580
581 * Added helper_method to designate that a given private or protected method you should available as a helper in the view. [bitsweat]
582
583 * Fixed assert_rendered_file so it actually verifies if that was the rendered file [htonl]
584
585 * Added the option for sharing partial spacer templates just like partials themselves [radsaq]
586
587 * Fixed that Russia was named twice in country_select [alexey]
588
589 * Fixed request_origin to use remote_ip instead of remote_addr [bitsweat]
590
591 * Fixed link_to breakage when nil was passed for html_options [alexey]
592
593 * Fixed redirect_to on a virtual server setup with apache with a port other than the default where it would forget the port number [seanohalpin]
594
595 * Fixed that auto-loading webrick on Windows would cause file uploads to fail [bitsweat]
596
597 * Fixed issues with sending files on WEBrick by setting the proper binmode [bitsweat]
598
599 * Added send_data as an alternative to send_file when the stream is not read off the filesystem but from a database or generated live [bitsweat]
600
601 * Added a new way to include helpers that doesn't require the include hack and can go without the explicit require. [bitsweat]
602
603   Before:
604
605     module WeblogHelper
606       def self.append_features(controller) #:nodoc:
607         controller.ancestors.include?(ActionController::Base) ? controller.add_template_helper(self) : super
608       end
609     end
610
611     require 'weblog_helper'
612     class WeblogController < ActionController::Base
613       include WeblogHelper
614     end
615    
616   After:
617
618     module WeblogHelper
619     end
620
621     class WeblogController < ActionController::Base
622       helper :weblog
623     end
624
625 * Added a default content-type of "text/xml" to .rxml renders [Ryan Platte]
626
627 * Fixed that when /controller/index was requested by the browser, url_for would generates wrong URLs [Ryan Platte]
628
629 * Fixed a bug that would share cookies between users when using FastCGI and mod_ruby [The Robot Co-op]
630
631 * Added an optional third hash parameter to the process method in functional tests that takes the session data to be used [alexey]
632
633 * Added UrlHelper#mail_to to make it easier to create mailto: style ahrefs
634
635 * Added better error messages for layouts declared with the .rhtml extension (which they shouldn't) [geech]
636
637 * Added another case to DateHelper#distance_in_minutes to return "less than a minute" instead of "0 minutes" and "1 minute" instead of "1 minutes"
638
639 * Added a hidden field to checkboxes generated with FormHelper#check_box that will make sure that the unchecked value (usually 0)
640   is sent even if the checkbox is not checked. This relieves the controller from doing custom checking if the the checkbox wasn't
641   checked. BEWARE: This might conflict with your run-on-the-mill work-around code. [Tobias Luetke]
642
643 * Fixed error_message_on to just use the first if more than one error had been added [marcel]
644
645 * Fixed that URL rewriting with /controller/ was working but /controller was not and that you couldn't use :id on index [geech]
646
647 * Fixed a bug with link_to where the :confirm option wouldn't be picked up if the link was a straight url instead of an option hash
648
649 * Changed scaffolding of forms to use <label> tags instead of <b> to please W3C [evl]
650
651 * Added DateHelper#distance_of_time_in_words_to_now(from_time) that works like distance_of_time_in_words,
652   but where <tt>to_time</tt> is fixed to <tt>Time.now</tt>.
653
654 * Added assert_flash_equal(expected, key, message), assert_session_equal(expected, key, message),
655   assert_assigned_equal(expected, key, message) to test the contents of flash, session, and template assigns.
656
657 * Improved the failure report on assert_success when the action triggered a redirection [alexey].
658
659 * Added "markdown" to accompany "textilize" as a TextHelper method for converting text to HTML using the Markdown syntax.
660   BlueCloth must be installed in order for this method to become available.
661
662 * Made sure that an active session exists before we attempt to delete it [Samuel]
663
664 * Changed link_to with Javascript confirmation to use onclick instead of onClick for XHTML validity [Scott Barron]
665
666
667 *0.9.0 (43)*
668
669 * Added support for Builder-based templates for files with the .rxml extension. These new templates are an alternative to ERb that
670   are especially useful for generating XML content, such as this RSS example from Basecamp:
671
672     xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
673       xml.channel do
674         xml.title(@feed_title)
675         xml.link(@url)
676         xml.description "Basecamp: Recent items"
677         xml.language "en-us"
678         xml.ttl "40"
679    
680         for item in @recent_items
681           xml.item do
682             xml.title(item_title(item))
683             xml.description(item_description(item)) if item_description(item)
684             xml.pubDate(item_pubDate(item))
685             xml.guid(@person.firm.account.url + @recent_items.url(item))
686             xml.link(@person.firm.account.url + @recent_items.url(item))
687        
688             xml.tag!("dc:creator", item.author_name) if item_has_creator?(item)
689           end
690         end
691       end
692     end
693
694     ...which will generate something like:
695
696     <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
697       <channel>
698         <title>Web Site Redesign</title>
699         <link>http://www.basecamphq.com/clients/travelcenter/1/</link>
700         <description>Basecamp: Recent items</description>
701         <language>en-us</language>
702         <ttl>40</ttl>
703         <item>
704           <title>Post: don't you know</title>
705           <description>&amp;lt;p&amp;gt;deeper and down&amp;lt;/p&amp;gt;</description>
706           <pubDate>Fri, 20 Aug 2004 21:13:50 CEST</pubDate>
707           <guid>http://www.basecamphq.com/clients/travelcenter/1/msg/assets/96976/comments</guid>
708           <link>http://www.basecamphq.com/clients/travelcenter/1/msg/assets/96976/comments</link>
709           <dc:creator>David H. Heinemeier</dc:creator>
710         </item>
711         <item>
712           <title>Milestone completed: Design Comp 2</title>
713           <pubDate>Mon,  9 Aug 2004 14:42:06 CEST</pubDate>
714           <guid>http://www.basecamphq.com/clients/travelcenter/1/milestones/#49</guid>
715           <link>http://www.basecamphq.com/clients/travelcenter/1/milestones/#49</link>
716         </item>
717       </channel>
718     </rss>
719
720   The "xml" local variable is automatically available in .rxml templates. You construct the template by calling a method with the name
721   of the tag you want. Options for the tag can be specified as a hash parameter to that method.
722
723   Builder-based templates can be mixed and matched with the regular ERb ones. The only thing that differentiates them is the extension.
724   No new methods have been added to the public interface to handle them.
725  
726   Action Pack ships with a version of Builder, but it will use the RubyGems version if you have one installed.
727  
728   Read more about Builder on: http://onestepback.org/index.cgi/Tech/Ruby/StayingSimple.rdoc
729  
730   [Builder is created by Jim Weirich]
731
732 * Added much improved support for functional testing [what-a-day].
733
734     # Old style
735     def test_failing_authenticate
736       @request.request_uri = "/login/authenticate"
737       @request.action = "authenticate"
738       @request.request_parameters["user_name"] = "nop"
739       @request.request_parameters["password"]  = ""
740  
741       response = LoginController.process_test(@request)
742  
743       assert_equal "The username and/or password you entered is invalid.", response.session["flash"]["alert"]
744       assert_equal "http://37signals.basecamp.com/login/", response.headers["location"]
745     end
746
747     # New style
748     def test_failing_authenticate
749       process :authenticate, "user_name" => "nop", "password" => ""
750       assert_flash_has 'alert'
751       assert_redirected_to :action => "index"
752     end
753
754   See a full example on http://codepaste.org/view/paste/334
755
756 * Increased performance by up to 100% with a revised cookie class that fixes the performance problems with the
757   default one that ships with 1.8.1 and below. It replaces the inheritance on SimpleDelegator with DelegateClass(Array)
758   following the suggestion from Matz on:
759   http://groups.google.com/groups?th=e3a4e68ba042f842&seekm=c3sioe%241qvm%241%40news.cybercity.dk#link14
760
761 * Added caching for compiled ERb templates. On Basecamp, it gave between 8.5% and 71% increase in performance [Andreas Schwarz].
762
763 * Added implicit counter variable to render_collection_of_partials [Marcel]. From the docs:
764
765     <%= render_collection_of_partials "ad", @advertisements %>
766    
767     This will render "advertiser/_ad.rhtml" and pass the local variable +ad+ to the template for display. An iteration counter
768     will automatically be made available to the template with a name of the form +partial_name_counter+. In the case of the
769     example above, the template would be fed +ad_counter+.
770
771 * Fixed problems with two sessions being maintained on reset_session that would particularly screw up ActiveRecordStore.
772
773 * Fixed reset_session to start an entirely new session instead of merely deleting the old. So you can now safely access @session
774   after calling reset_ression and expect it to work.
775
776 * Added @request.get?, @request.post?, @request.put?, @request.delete? as convenience query methods for @request.method [geech]
777
778 * Added @request.method that'll return a symbol representing the HTTP method, such as :get, :post, :put, :delete [geech]
779
780 * Changed @request.remote_ip and @request.host to work properly even when a proxy is in front of the application [geech]
781
782 * Added JavaScript confirm feature to link_to. Documentation:
783
784     The html_options have a special feature for creating javascript confirm alerts where if you pass
785     :confirm => 'Are you sure?', the link will be guarded with a JS popup asking that question.
786     If the user accepts, the link is processed, otherwise not.
787
788 * Added link_to_unless_current as a UrlHelper method [Sam Stephenson]. Documentation:
789
790     Creates a link tag of the given +name+ using an URL created by the set of +options+, unless the current
791     controller, action, and id are the same as the link's, in which case only the name is returned (or the
792     given block is yielded, if one exists). This is useful for creating link bars where you don't want to link
793     to the page currently being viewed.
794
795 * Fixed that UrlRewriter (the driver for url_for, link_to, etc) would blow up when the anchor was an integer [alexey]
796
797 * Added that layouts defined with no directory defaults to layouts. So layout "weblog/standard" will use
798   weblog/standard (as always), but layout "standard" will use layouts/standard.
799
800 * Fixed that partials (or any template starting with an underscore) was publically viewable [Marten]
801
802 * Added HTML escaping to text_area helper.
803
804 * Added :overwrite_params to url_for and friends to keep the parameters as they were passed to the current action and only overwrite a subset.
805   The regular :params will clear the slate so you need to manually add in existing parameters if you want to reuse them. [raphinou]
806
807 * Fixed scaffolding problem with composite named objects [Moo Jester]
808
809 * Added the possibility for shared partials. Example:
810
811     <%= render_partial "advertisement/ad", ad %>
812  
813   This will render the partial "advertisement/_ad.rhtml" regardless of which controller this is being called from.
814  
815   [Jacob Fugal]
816
817 * Fixed crash when encountering forms that have empty-named fields [James Prudente]
818
819 * Added check_box form helper method now accepts true/false as well as 1/0 [what-a-day]
820
821 * Fixed the lacking creation of all directories with install.rb [Dave Steinberg]
822
823 * Fixed that date_select returns valid XHTML selected options [Andreas Schwarz]
824
825 * Fixed referencing an action with the same name as a controller in url_for [what-a-day]
826
827 * Fixed the destructive nature of Base#attributes= on the argument [Kevin Watt]
828
829 * Changed ActionControllerError to decent from StandardError instead of Exception. It can now be caught by a generic rescue.
830
831 * Added SessionRestoreError that is raised when a session being restored holds objects where there is no class available.
832
833 * Added block as option for inline filters. So what used to be written as:
834
835     before_filter Proc { |controller| return false if controller.params["stop_action"] }
836
837   ...can now be as:
838
839     before_filter { |controller| return false if controller.params["stop_action"] }
840  
841   [Jeremy Kemper]
842
843 * Made the following methods public (was protected): url_for, controller_class_name, controller_name, action_name
844   This makes it easier to write filters without cheating around the encapsulation with send.
845
846 * ActionController::Base#reset_session now sticks even if you access @session afterwards [Kent Sibilev]
847
848 * Improved the exception logging so the log file gets almost as much as in-browser debugging.
849
850 * Changed base class setup from AbstractTemplate/ERbTemplate to ActionView::Base. This change should be harmless unless you were
851   accessing Action View directly in which case you now need to reference the Base class.\
852
853 * Added that render_collection_of_partials returns nil if the collection is empty. This makes showing a “no items” message easier.
854   For example: <%= render_collection_of_partials("message", @messages) || "No messages found." %> [Sam Stephenson]
855
856 * Added :month_before_year as an option to date_select to get the month select before the year. Especially useful for credit card forms.
857
858 * Added :add_month_numbers to select_month to get options like "3 - March".
859
860 * Removed Base.has_active_layout? as it couldn't answer the question without the instance. Use Base#active_layout instead.
861
862 * Removed redundant call to update on ActionController::Base#close_session [Andreas Schwarz]
863
864 * Fixed that DRb Store accidently started its own server (instead of just client) [Andreas]
865
866 * Fixed strip_links so it now works across multiple lines [Chad Fowler]
867
868 * Fixed the TemplateError exception to show the proper trace on to_s (useful for unit test debugging)
869
870 * Implemented class inheritable attributes without eval [Caio Chassot]
871
872 * Made TextHelper#concat accept binding as it would otherwise not work
873
874 * The FormOptionsHelper will now call to_s on the keys and values used to generate options
875
876
877 *0.8.5*
878
879 * Introduced passing of locally scoped variables between templates:
880
881     You can pass local variables to sub templates by using a hash of with the variable
882     names as keys and the objects as values:
883    
884       <%= render "shared/header", { "headline" => "Welcome", "person" => person } %>
885    
886     These can now be accessed in shared/header with:
887    
888       Headline: <%= headline %>
889       First name: <%= person.first_name %>
890    
891 * Introduced the concept of partials as a certain type of sub templates:
892
893     There's also a convenience method for rendering sub templates within the current
894     controller that depends on a single object (we call this kind of sub templates for
895     partials). It relies on the fact that partials should follow the naming convention
896     of being prefixed with an underscore -- as to separate them from regular templates
897     that could be rendered on their own. In the template for Advertiser#buy, we could have:
898    
899       <% for ad in @advertisements %>
900         <%= render_partial "ad", ad %>
901       <% end %>
902    
903     This would render "advertiser/_ad.rhtml" and pass the local variable +ad+
904     for the template to display.
905    
906     == Rendering a collection of partials
907    
908     The example of partial use describes a familar pattern where a template needs
909     to iterate over a array and render a sub template for each of the elements.
910     This pattern has been implemented as a single method that accepts an array and
911     renders a partial by the same name of as the elements contained within. So the
912     three-lined example in "Using partials" can be rewritten with a single line:
913    
914       <%= render_collection_of_partials "ad", @advertisements %>
915    
916     So this will render "advertiser/_ad.rhtml" and pass the local variable +ad+ for
917     the template to display.
918
919 * Improved send_file by allowing a wide range of options to be applied [Jeremy Kemper]:
920
921     Sends the file by streaming it 4096 bytes at a time. This way the
922     whole file doesn't need to be read into memory at once.  This makes
923     it feasible to send even large files.
924    
925     Be careful to sanitize the path parameter if it coming from a web
926     page.  send_file(@params['path'] allows a malicious user to
927     download any file on your server.
928    
929     Options:
930     * <tt>:filename</tt> - specifies the filename the browser will see. 
931       Defaults to File.basename(path).
932     * <tt>:type</tt> - specifies an HTTP content type. 
933       Defaults to 'application/octet-stream'.
934     * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded. 
935       Valid values are 'inline' and 'attachment' (default).
936     * <tt>:buffer_size</tt> - specifies size (in bytes) of the buffer used to stream
937       the file.  Defaults to 4096.
938    
939     The default Content-Type and Content-Disposition headers are
940     set to download arbitrary binary files in as many browsers as
941     possible.  IE versions 4, 5, 5.5, and 6 are all known to have
942     a variety of quirks (especially when downloading over SSL).
943    
944     Simple download:
945       send_file '/path/to.zip'
946    
947     Show a JPEG in browser:
948       send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline'
949    
950     Read about the other Content-* HTTP headers if you'd like to
951     provide the user with more information (such as Content-Description).
952     http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
953    
954     Also be aware that the document may be cached by proxies and browsers.
955     The Pragma and Cache-Control headers declare how the file may be cached
956     by intermediaries.  They default to require clients to validate with
957     the server before releasing cached responses.  See
958     http://www.mnot.net/cache_docs/ for an overview of web caching and
959     http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
960     for the Cache-Control header spec.
961
962 * Added pluralize method to the TextHelper that makes it easy to get strings like "1 message", "3 messages"
963
964 * Added proper escaping for the rescues [Andreas Schwartz]
965
966 * Added proper escaping for the option and collection tags [Andreas Schwartz]
967
968 * Fixed NaN errors on benchmarking [Jim Weirich]
969
970 * Fixed query string parsing for URLs that use the escaped versions of & or ; as part of a key or value
971
972 * Fixed bug with custom Content-Type headers being in addition to rather than instead of the default header.
973   (This bug didn't matter with neither CGI or mod_ruby, but FCGI exploded on it) [With help from Ara T. Howard]
974
975
976 *0.8.0*
977
978 * Added select, collection_select, and country_select to make it easier for Active Records to set attributes through
979   drop-down lists of options. Example:
980  
981     <%= select "person", "gender", %w( Male Female ) %>
982    
983   ...would give the following:
984  
985     <select name="person[gender]" id="person_gender"><option>Male</option><option>Female</option></select>
986
987 * Added an option for getting multiple values on a single form name into an array instead of having the last one overwrite.
988   This is especially useful for groups of checkboxes, which can now be written as:
989  
990     <input type="checkbox" name="rights[]" value="CREATE" />
991     <input type="checkbox" name="rights[]" value="UPDATE" />
992     <input type="checkbox" name="rights[]" value="DELETE" />
993  
994   ...and retrieved in the controller action with:
995  
996     @params["rights"] # => [ "CREATE", "UPDATE", "DELETE" ]
997  
998   The old behavior (where the last one wins, "DELETE" in the example) is still available. Just don't add "[]" to the
999   end of the name. [Scott Baron]
1000  
1001 * Added send_file which uses the new render_text block acceptance to make it feasible to send large files.
1002   The files is sent with a bunch of voodoo HTTP headers required to get arbitrary files to download as
1003   expected in as many browsers as possible (eg, IE hacks). Example:
1004  
1005   def play_movie
1006     send_file "/movies/that_movie.avi"
1007   end
1008  
1009   [Jeremy Kemper]
1010
1011 * render_text now accepts a block for deferred rendering. Useful for streaming large files, displaying
1012   a “please wait” message during a complex search, etc. Streaming example:
1013  
1014     render_text do |response|
1015       File.open(path, 'rb') do |file|
1016         while buf = file.read(1024)
1017           print buf
1018         end
1019       end
1020     end
1021  
1022   [Jeremy Kemper]
1023
1024 * Added a new Tag Helper that can generate generic tags programmatically insted of through HTML. Example:
1025    
1026     tag("br", "clear" => "all") => <br clear="all" />
1027  
1028   ...that's usually not terribly interesting (unless you have a lot of options already in a hash), but it
1029   gives way for more specific tags, like the new form tag:
1030  
1031     form_tag({ :controller => "weblog", :action => "update" }, { :multipart => "true", "style" => "width: 200px"}) =>
1032       <form action="/weblog/update" enctype="multipart/formdata" style="width: 200px">
1033    
1034   There's even a "pretty" version for people who don't like to open tags in code and close them in HTML:
1035  
1036     <%= start_form_tag :action => "update" %>
1037       # all the input fields
1038     <%= end_form_tag %>
1039  
1040   (end_form_tag just returns "</form>")
1041
1042 * The selected parameter in options_for_select may now also an array of values to be selected when
1043   using a multiple select. Example:
1044
1045     options_for_select([ "VISA", "Mastercard", "Discover" ], ["VISA", "Discover"]) =>
1046       <option selected>VISA</option>\n<option>Mastercard</option>\n<option selected>Discover</option>
1047      
1048   [Scott Baron]
1049
1050 * Changed the URL rewriter so controller_prefix and action_prefix can be used in isolation. You can now do:
1051
1052     url_for(:controller_prefix => "clients")
1053
1054   ...or:
1055  
1056     url_for(:action_prefix => "category/messages")
1057
1058   Neither would have worked in isolation before (:controller_prefix required a :controller and :action_prefix required an :action)
1059
1060 * Started process of a cleaner separation between Action Controller and ERb-based Action Views by introducing an
1061   abstract base class for views. And Amita adapter could be fitted in more easily now.
1062
1063 * The date helper methods date_select and datetime_select now also use the field error wrapping
1064   (div with class fieldWithErrors by default).
1065
1066 * The date helper methods date_select and datetime_select can now discard selects
1067
1068 * Added option on AbstractTemplate to specify a different field error wrapping. Example:
1069
1070     ActionView::AbstractTemplate.field_error_proc = Proc.new do |html, instance|
1071       "<p>#{instance.method_name + instance.error_message}</p><div style='background-color: red'>#{html}</div>"
1072     end
1073
1074   ...would give the following on a Post#title (text field) error:
1075  
1076     <p>Title can't be empty</p>
1077     <div style='background-color: red'>
1078       <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />
1079     </div>
1080
1081 * The UrlHelper methods url_for and link_to will now by default only return paths, not complete URIs.
1082   That should make it easier to fit a Rails application behind a proxy or load-balancer.
1083   You can overwrite this by passing :only_path => false as part of the options. [Suggested by U235]
1084
1085 * Fixed bug with having your own layout for use with scaffolding [Kevin Radloff]
1086
1087 * Fixed bug where redirect_to_path didn't append the port on non-standard ports [dhawkins]
1088
1089 * Scaffolding plays nicely with single-table inheritance (LoadErrors are caught) [Jeremy Kemper]
1090
1091 * Scaffolding plays nice with plural models like Category/categories [Jeremy Kemper]
1092
1093 * Fixed missing suffix appending in scaffolding [Kevin Radloff]
1094
1095
1096 *0.7.9*
1097
1098<