leethal said:
You can also rename views to just some_thing.erb. The MIME identifier isn’t mandatory, and not specifying it means that Rails will use that template for all mimes.
For simple Ruby on Rails apps that use very few plugins, upgrading may be as simple as:
rake rails:update
For everyone else, there may be some work to do.
Internally, Rails has undergone many changes which broken compatibility with a variety of gems and plugins. Luckily most of them have been updated to be compatible with Rails 2.1
I had to upgrade the following:
active_scaffold, flex_image, haml, has_many_polymorphs, will_paginate
If you suspect that one of the plugins you use is causing problems, check for a newer version. There’s a good chance that it’s been upgraded to be Rails 2.1 compatible.
has_finder’s functionality has been included in Rails 2.1 as ‘named_scope’. The plugin will interfere with this functionality and crash your app. Simply remove the plugin, and change your code from ‘has_finder’ to ‘named_scope’
Remember the garbage collection hacks? Get rid of them! The internals have changed, and at the very least they’ll break ActiveRecord.
Some plugins such as FlexImage have totally changed their api to be more ‘rails compatible’. In this case you’ll have to make some changes to comply with the new API interface
Often an xhr response will do something like:
page.update_html 'some_element', render(:partial => 'some_controller/some_thing')
This may break in Rails 2.1, with an error message:
Missing template some_controller/_some_thing.js.erb
If you want to render a partial html template in a rjs template, you must specify the file extension.
page.update_html 'some_element', render(:partial => 'some_controller/some_thing.html.erb')
You can also rename views to just some_thing.erb. The MIME identifier isn’t mandatory, and not specifying it means that Rails will use that template for all mimes.
Thanks for the clarification. Also, I believe that the ‘old way’ works in Edge rails. I could be wrong though.
Hey,
I am trying to upgrade my rails app from rails1.2.3 to rails 2.1. I am issues with fleximage: Can you please help me out on how exactly you upgraded fleximage. I use to have this in views: for bigger size: <%= image_tag (url_for({:controller => ‘images’ , :action => ‘thumb’, :id => @profile.photo}) %> in my app.
For smaller size: <%= image_tag (url_for({:controller => ‘images’ , :action => ‘feed’, :id => @profile.photo}) %>
I had defined different actions for feed and thumb in controller and flexi defined too..
Can you help me out in upgrading this?
I also had issues with exception_notifier and acts_as_rateable. Did you use these plugins?
Hey,
I am trying to upgrade my rails app from rails1.2.3 to rails 2.1. I am issues with fleximage: Can you please help me out on how exactly you upgraded fleximage. I use to have this in views: for bigger size: <%= image_tag (url_for({:controller => ‘images’ , :action => ‘thumb’, :id => @profile.photo}) %> in my app.
For smaller size: <%= image_tag (url_for({:controller => ‘images’ , :action => ‘feed’, :id => @profile.photo}) %>
I had defined different actions for feed and thumb in controller and flexi defined too..
Can you help me out in upgrading this?
I also had issues with exception_notifier and acts_as_rateable. Did you use these plugins?
Have you upgraded those plugins to their newest versions? I use the newest version of exception_notifier, and it works exactly the same as previous versions.
The new Rails 2.1 compatible version of flex_image has an entirely different API. You can read more about it here: http://github.com/Squeegy/fleximage/wikis/gettingstarted
Thanks for the clarification. Also, I believe that the ‘old way’ works in Edge rails. I could be wrong though.
Yeah it’s quite simple really: [action name].[mime extension].[template type]. And the mime extension part is optional. index.erb, index.rjs, index.xml.erb and show.js.builder is all valid =)