Practical eCommerce

Developer’s Diary Blog Home · F.A.Q.'s

HOME · Saturday, July 5, 2008

Developer’s Diary

Rails 2.0 Has Been Released!

I’m certainly not the first person to put this information out there, but for anyone that has been following this blog for Rails information should be aware that the newest version has been released. Rails 2.0 boasts a series of new features and improvements, most of which appear to me to be under the hood more than right in your face. Most notable to me are the following changes and new features:

1. View template file name changes.
In order to more accurately reflect what Rails is doing, all generators will now use a new naming convention with regards to view templates. In the past a view file might be called something like “articles.rhtml”, which would denote that an HTML view is to be rendered. In an effort to separate out the MIME type and the renderer of the view, the new naming convention will use names such as “articles.html.erb”. In this example, you can see that the file name shows a MIME type of HTML, and that the ERB renderer should be used to render the output. What would previously have been “articles_rss.rxml” would now be called “articles_rss.xml.builder”, telling us that the MIME type will be XML and that Rails will use the Builder renderer to show the view. Older template file names will still work until Rails 3.0 is released, so this one is going to be a phased transition.

2. Security Enhancements to the “Sanitize” Method.
Before last week, using the “sanitize” method to try and prevent XSS attacks was not the best option in the world. Rather, most people (such as myself) opted to use the “white_list” plugin for Rails. Rather than the blacklisting of certain tags with “sanitize”, the white_list plugin worked by letting developers specify exactly which tags ARE allowed, rather than which are not. Much more secure, and with Rails 2.0 the “sanitize” method has been greatly improved. In fact, it has taken the form of a white_list, replacing that plugin. This is one of many security improvements in Rails 2.0.

3. Native Pagination is Gone.
Rails 2.0 has removed the “paginate” methods for creating multiple pages of results, opting instead to have that functionality abstracted out to a plugin. I’m not sure what I think about this one, as the native pagination methods have proven to me that they need work. However, currently I use them in conjunction with a customized pagination method to get the results that I want. My presumption here is that the available plugins will be just fine to get things done, since pagination is something that we all use.

4. Improved Control Over Representations
I’ll admit that I haven’t gotten too deep into this one, but there appear to be a lot of improvements in the area of presenting multiple views from only one action. From what I can tell, this is done using the “initializers” that Rails 2.0 offers, allowing you to define particular “MIME” types in your application. This is somewhat related to the first point above, but a little different. For example, we can now tell Rails that we want to internally define a MIME type of “iphone” and have the actual MIME type that it announces to a browser be “text/html”. We can now do that in our Rails 2.0 applications and then we can use views with file names like “articles.iphone.erb”. This let’s you have a single action that can respond in a series of formats such as “articles.html.erb”, “articles.xml.builder” and “articles.iphone.erb”. It might seem confusing, but to me this is a great improvement, and will help with organization of application code.

↑ Back to Top

Comments:

Jonathon Hill Says:

I am intrigued by Ruby and plan in the future to learn about it and find out why everyone’s buzzing.

I love new development, being a developer myself, but one thing we have to remember is that new and hip does not necessarily equal useful and profitable.

Read this article http://www.useit.com/alertbox/web-2.html by Jakob Nielsen, the worldwide usability expert.

By the way, I think Practical e-Commerce could add a great deal more value to their publication by regularly sharing the findings and research of Mr. Nielsen and other usability experts.

Usability may not be as exciting as hip technologies, especially to developers, but there’s no quicker way to increase your ROI and effectiveness than by following usability guidelines and doing usability studies on your project/product.

Lori Says:

Sorry. You lost me when you did not explain anywhere in this article what “Rails” is.

Andres Says:

Hi Lori, there’s this thing called ‘google’ that the ancients invented. It’s great for learning about all sorts of terms and ideas.


Leave a Comment:

Brian Getting

Brian Getting is the Online Director at Practical eCommerce, specializing in website design and application development.

Calendar

July 2008
S M T W T F S
« May    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

Browse blog posts by category.

RSS Content Feeds

Technorati Tags

Ecommerce Articles

Browse All Articles
Browse our complete archive of ecommerce articles.
Accounting, Management & Legal
Ecommerce articles related to managing a small business including ecommerce accounting, business strategy and legal considerations.
Conversion & Usability
Online business articles about converting web site visitors into customers and how to gauge and improve your business website's usability.
Development & Programming
Articles to help designers, developers and programmers create successful, search engine friendly ecommerce websites and improve existing ones.
Hosting, Infrastructure & Software
Articles for ecommerce businesses about ecommerce web hosting, business infrastructure, business strategy and helpful ecommerce & small business software.
Interviews & Profiles
Interviews with prominent ecommerce business personalities and profiles of successful online businesses.
Inventory & Shipping
Ecommerce articles about inventory management, ecommerce order fulfillment and product shipping considerations.
Marketing & Revenue Growth
Articles relating to online marketing, email marketing and using the Internet to growing your business.
Search Engine Optimization
Search engine optimization articles for ecommerce business owners, strategists, marketers and developers.
Shopping Carts & Online Payments
Articles covering ecommerce shopping cart platforms and options for choosing an online payment gateway.
Training & Education
Tutorials and articles providing training and education for ecommerce business owners and developers of ecommerce websites.

Search Articles

Ecommerce Community

Ecommerce Blogs
Read our blogs about ecommerce topics written by industry professionals.
Community Forum
Connect with other ecommerce professionals to trade advice and answers in our community forum.
Podcasts
Check out our ecommerce podcasts covering topics ranging from interviews to tutorials.
RSS Content Feeds
Subscribe to our RSS feeds and have fresh ecommerce content delivered to you.

Ecommerce Resources

Free Email Newsletter
Sign up for Ecommerce Notes, our free email newsletter for ecommerce business owners and developers.
Ecommerce Directory
Browse our directory of ecommerce products and services, or submit your own listing in our directory.
Ecommerce Glossary
Familiarize yourself with terminology or submit terms to help others with our Ecommerce Glossary.
Events Calendar
Find out about upcoming ecommerce events or invite other ecommerce professionals by posting your own event.
Press Releases
Browse ecommerce related press releases and post your own press release for distribution.
Ecommerce Store & Back Issues
Pick up back issues of Practical eCommerce magazine along with other merchandise from Practical Ecommerce

About Practical eCommerce

Frequently Asked Questions
Look at frequently asked questions regarded using our website, subscribing to our magazine and more.
Advertising Information
Information about advertising in Practical eCommerce magazine, on our website, or in our email newsletters.
Editorial Sharing
Learn about options for sharing our content with your visitors, customers or employees.
About Us
Learn more about Practical Ecommerce magazine and meet our staff.
Contact Us
Contact Practical Ecommerce at any time for more information. We'd love to hear from you.
AdvertisementMarketplace EarthEndicia

Copyright 2007 Confluence Distribution, Inc. and Practical eCommerce.
All Rights Reserved.

Privacy PolicyConditions of UseContact Us