Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. h3. Views
  2.  
  3. * Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]
  4.  
  5. * Added access to nested attributes in RJS #4548 [richcollins@gmail.com]. Examples:
  6.  
  7. page['foo']['style'] # => $('foo').style;
  8. page['foo']['style']['color'] # => $('blank_slate').style.color;
  9. page['foo']['style']['color'] = 'red' # => $('blank_slate').style.color = 'red';
  10. page['foo']['style'].color = 'red' # => $('blank_slate').style.color = 'red';
  11.  
  12. * Deprecated the auto-appending of .png to AssetTagHelper#image_tag calls that doesn't have an extension [DHH]
  13.  
  14. * 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]
  15.  
  16. * Added automated timestamping to AssetTagHelper methods for stylesheets, javascripts, and images when Action Controller is run under Rails [DHH]. Example:
  17.  
  18. image_tag("rails.png") # => '<img alt="Rails" src="/images/rails.png?1143664135" />'
  19.  
  20. ...to avoid frequent stats (not a problem for most people), you can set RAILS_ASSET_ID in the ENV to avoid stats:
  21.  
  22. ENV["RAILS_ASSET_ID"] = "2345"
  23. image_tag("rails.png") # => '<img alt="Rails" src="/images/rails.png?2345" />'
  24.  
  25. This can be used by deployment managers to set the asset id by application revision
  26.  
  27. h3. Controllers
  28.  
  29. * Deprecation: @cookies, @headers, @request, @response will be removed after 1.2. Use the corresponding method instead. [Jeremy Kemper]
  30.  
  31. * Add head(options = {}) for responses that have no body. [Jamis Buck]. Examples:
  32.  
  33. head :status => 404 # return an empty response with a 404 status
  34. head :location => person_path(@person), :status => 201
  35.  
  36. * Declare file extensions exempt from layouts. #6219 [brandon]
  37. Example: ActionController::Base.exempt_from_layout 'rpdf'
  38.  
  39. * Load helpers in alphabetical order for consistency. Resolve cyclic javascript_helper dependency. #6132, #6178 [choonkeat@gmail.com]
  40.  
  41. * 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]
  42.  
  43. * Added Mime::Type.register(string, symbol, synonyms = []) for adding new custom mime types [DHH]. Example: Mime::Type.register("image/gif", :gif)
  44.  
  45.  
  46. * 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:
  47.  
  48. class WeblogController < ActionController::Base
  49. def index
  50. @posts = Post.find :all
  51.  
  52. respond_to do |format|
  53. format.html
  54. format.xml { render :xml => @posts.to_xml }
  55. format.rss { render :action => "feed.rxml" }
  56. end
  57. end
  58. end
  59.  
  60.  
  61.  
  62. * 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]
  63.  
  64.  
  65. h3. Routing and URLs
  66.  
  67. * 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]
  68.  
  69. map.connect '/foo/:id', :controller => '...', :action => '...'
  70. map.connect '/foo/:id.:format', :controller => '...', :action => '...'
  71. map.connect '/foo/:id', ..., :conditions => { :method => :get }
  72.  
  73.  
  74. * Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar]
  75.  
  76. * Added map.resources from the Simply Restful plugin [DHH]. Examples (the API has changed to use plurals!):
  77.  
  78. map.resources :messages
  79. map.resources :messages, :comments
  80. map.resources :messages, :new => { :preview => :post }
  81.  
  82.  
  83. h3. Testing
  84.  
  85. * assert_response supports symbolic status codes. #6569 [Kevin Clark]
  86.  
  87. <pre>
  88. assert_response :ok
  89. assert_response :not_found
  90. assert_response :forbidden
  91. </pre>
  92.  
  93. * Added assert_select* for CSS selector-based testing (deprecates assert_tag) #5936 [assaf.arkin@gmail.com]
  94.  
  95. h3. Deprecated
  96.  
  97. * 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]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement