Guest User

Untitled

a guest
Feb 21st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1.  
  2.  
  3. h3. Views
  4.  
  5. * Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]
  6.  
  7. * Added access to nested attributes in RJS #4548 [richcollins@gmail.com]. Examples:
  8.  
  9. page['foo']['style'] # => $('foo').style;
  10. page['foo']['style']['color'] # => $('blank_slate').style.color;
  11. page['foo']['style']['color'] = 'red' # => $('blank_slate').style.color = 'red';
  12. page['foo']['style'].color = 'red' # => $('blank_slate').style.color = 'red';
  13.  
  14. * Deprecated the auto-appending of .png to AssetTagHelper#image_tag calls that doesn't have an extension [DHH]
  15.  
  16. * Added months and years to the resolution of DateHelper#distance_of_time_in_words, such that "60 days ago" becomes "2 months ago" #5611 [pjhyett@gmail.com]
  17.  
  18. * Added automated timestamping to AssetTagHelper methods for stylesheets, javascripts, and images when Action Controller is run under Rails [DHH]. Example:
  19.  
  20. image_tag("rails.png") # => '<img alt="Rails" src="/images/rails.png?1143664135" />'
  21.  
  22. ...to avoid frequent stats (not a problem for most people), you can set RAILS_ASSET_ID in the ENV to avoid stats:
  23.  
  24. ENV["RAILS_ASSET_ID"] = "2345"
  25. image_tag("rails.png") # => '<img alt="Rails" src="/images/rails.png?2345" />'
  26.  
  27. This can be used by deployment managers to set the asset id by application revision
  28.  
  29. h3. Controllers
  30.  
  31. * Deprecation: @cookies, @headers, @request, @response will be removed after 1.2. Use the corresponding method instead. [Jeremy Kemper]
  32.  
  33. * Add head(options = {}) for responses that have no body. [Jamis Buck]. Examples:
  34.  
  35. head :status => 404 # return an empty response with a 404 status
  36. head :location => person_path(@person), :status => 201
  37.  
  38. * Declare file extensions exempt from layouts. #6219 [brandon]
  39. Example: ActionController::Base.exempt_from_layout 'rpdf'
  40.  
  41. * Load helpers in alphabetical order for consistency. Resolve cyclic javascript_helper dependency. #6132, #6178 [choonkeat@gmail.com]
  42.  
  43. * Changed that uncaught exceptions raised any where in the application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static "Application error (Rails)" [DHH]
  44.  
  45. * Added Mime::Type.register(string, symbol, synonyms = []) for adding new custom mime types [DHH]. Example: Mime::Type.register("image/gif", :gif)
  46.  
  47.  
  48. * Added interrogation of params[:format] to determine Accept type. If :format is specified and matches a declared extension, like "rss" or "xml", that mime type will be put in front of the accept handler. This means you can link to the same action from different extensions and use that fact to determine output [DHH]. Example:
  49.  
  50. class WeblogController < ActionController::Base
  51. def index
  52. @posts = Post.find :all
  53.  
  54. respond_to do |format|
  55. format.html
  56. format.xml { render :xml => @posts.to_xml }
  57. format.rss { render :action => "feed.rxml" }
  58. end
  59. end
  60. end
  61.  
  62.  
  63.  
  64. * Added ActionController.filter_parameter_logging that makes it easy to remove passwords, credit card numbers, and other sensitive information from being logged when a request is handled. #1897 [jeremye@bsa.ca.gov]
  65.  
  66.  
  67. h3. Routing and URLs
  68.  
  69. * Routing rewrite. Simpler, faster, easier to understand. The published API for config/routes.rb is unchanged, but nearly everything else is different, so expect breakage in plugins and libs that try to fiddle with routes. [Nicholas Seckar, Jamis Buck]
  70.  
  71. map.connect '/foo/:id', :controller => '...', :action => '...'
  72. map.connect '/foo/:id.:format', :controller => '...', :action => '...'
  73. map.connect '/foo/:id', ..., :conditions => { :method => :get }
  74.  
  75.  
  76. * Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar]
  77.  
  78. * Added map.resources from the Simply Restful plugin [DHH]. Examples (the API has changed to use plurals!):
  79.  
  80. map.resources :messages
  81. map.resources :messages, :comments
  82. map.resources :messages, :new => { :preview => :post }
  83.  
  84.  
  85. h3. Testing
  86.  
  87. * assert_response supports symbolic status codes. #6569 [Kevin Clark]
  88.  
  89. <pre>
  90. assert_response :ok
  91. assert_response :not_found
  92. assert_response :forbidden
  93. </pre>
  94.  
  95. * Added assert_select* for CSS selector-based testing (deprecates assert_tag) #5936 [assaf.arkin@gmail.com]
  96.  
  97. h3. Deprecated
  98.  
  99. * Deprecation! @params, @session, @flash will be removed after 1.2. Use the corresponding instance methods instead. You'll get printed warnings during tests and logged warnings in dev mode when you access either instance variable directly. [Jeremy Kemper]
Add Comment
Please, Sign In to add comment