The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rush to Rails 1.2 Adds Tons of New Features

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bob Silva

Posts: 94
Nickname: bobsilva
Registered: Feb, 2006

Bob Silva is a Rails Developer for the UMESD
Rush to Rails 1.2 Adds Tons of New Features Posted: Sep 5, 2006 11:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Bob Silva.
Original Post: Rush to Rails 1.2 Adds Tons of New Features
Feed Title: Rails Video Tutorials
Feed URL: http://www.railtie.net/xml/rss/feed.xml
Feed Description: A growing collection of screencasts that show you how to use the many facets of the wonderful world of rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Bob Silva
Latest Posts From Rails Video Tutorials

Advertisement
The Rails Developers are rushing to get a 1.2 release out the door before RailsConf Europe. I'll try to list a quick run down of changes you'll may not be aware of in 1.2:
  • Access nested attributes in RJS templates. Now you can use syntax like this: page[:foo][:style][:color] which will generate javascript like: $('foo').style.color

  • Michael Koziarski is my hero for this change. If you've ever tried to use a 'quote' column in your model, you quickly found out that it conflicted with AR's quote column method. No longer is this an issue. def quote has been changed to def quote_value

  • Calling image_tag without the file extension now raises a Deprecation warning. In 2.0, it will no longer append .png to the file name. This is welcome change, unneeded magic is well...unneeded.

  • Now you can access the locals hash directly in your partials. In your partials, you can check if a local varialbe was passed in by doing: if locals[:local_var] then ...

  • In 2.0, the default for foreign_keys will be the association name, rather than the class name. So if you specify a :class_name with no :foreign_key on your belongs_to associations, it will throw a Deprecation warning. The tests explain this pretty well:

    def test_deprecated_inferred_foreign_key  
      assert_not_deprecated { Company.belongs_to :firm }  
      assert_not_deprecated { Company.belongs_to :client, :foreign_key => "firm_id" }  
      assert_not_deprecated { Company.belongs_to :firm, :class_name => "Firm", :foreign_key => "client_of" }  
      assert_deprecated("inferred foreign_key name") { Company.belongs_to :client, :class_name => "Firm" }  
    end 

  • The Ruby/MySQL driver that ships with Rails has been updated to work with the new authentication in MySQL 4.1+. Of course, everyone uses the Ruby C bindings to MySQL right?

  • My own patch to distance_of_time_in_words was applied. What does this mean to you? Nothing at all, I just wanted to tell you about it.

  • Some nice additions to Prototype Element Handling. You can now traverse the DOM using the new Element.up, Element.down, Element.previous and Element.next methods. To make debugging easier, you can use Element.inspect. Check out the changeset for more useful changes.

    Examples:  
      <div id="sidebar">                   -> $('nav').up() or $('menu').up('div')   
        <ul id="nav">                     -> $('sidebar').down()  or $('sidebar').down('ul') or $('menu').previous()  
          <li>...</li>                    -> $('sidebar').down(1) or $('sidebar').down('li')  
          <li>...</li>                    -> $('sidebar').down(2) or $('sidebar').down('li', 2) or $('sidebar').down('li').next('li')  
           <li class="selected">...</li>    -> $('sidebar').down('li.selected')  
         </ul>                               
         <ul id="menu">                    -> $('sidebar').down('ul').next()  
    
    

  • Rails will actually use the 500.html thats been sitting in public for awhile when your application fails to catch an exception not related to routing.

  • In the testing department, assert_tag has been deprecated in favor of the new assert_select family of assertions.

  • Another one of my patches got applied. radio_button_tag now generates a unique id attribute based on the name_value pattern.

  • And plenty of other deprecation warnings throughout Rails...those you can figure out for yourself. Kevin got thrashed for telling people about them.

Read: Rush to Rails 1.2 Adds Tons of New Features

Topic: Django is great Previous Topic   Next Topic Topic: ruby quine _slightly_ smaller than python quine

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use