Ajax problem migrating to Rails 2.0

Hi, I was developping an application and everything was working properely, until I decided to migrate to RoR 2.0. I was using Scriptaculous to add new itens to a list using Highlight visual effect. But in RoR 2.0 when I press submit button in the form, only the partial is rendered to the browser, not the entire page, with the new item added with highlight effect. What should I do to correct this?

Here the code:

The partial: _area.html.erb <li id="area_<%= area.id %>">   <div class="nome_item">     <%= area.nome -%>   </div>   <small>   <%= link_to "Editar", :action => "editar", :id => area.id %>   <%= link_to_remote "", :url=> {:action => "excluir", :id => area.id} %>   </small> </li>

The list in the mais view page: lista.html.erb ... <!-- Lista areas existentes -->   <ul id="item_lista">     <%= render :partial => 'area/area', :collection => @areas %>   </ul> ...

The criar.js.rjs: if @area.new_record?   page.alert @area.errors.full_messages.join("\n") else   page.insert_html :top, 'item_lista', :partial => 'area'   page.visual_effect :highlight, "area_#{@area.id}"   page.form.reset 'area_form' end

The controller: area_controller.rb ...   def lista     @areas = Area.find(:all, :conditions => ["conta_id = ?", session[:usuario].conta], :order => "id DESC")   end

  def criar     @area = Area.new(params[:area])     @area.conta = session[:usuario].conta     if @area.save       return if request.xhr?       render :partial => 'area', :object => @area     else       flash.now[:notice] = "N&atilde;o deu certo. Tente novamente."       render :controller => 'area', :action => 'lista'     end   end ...

Thanks a lot.

Hi, how did you migrate from Rails version X to Rails 2.0.2? For example, did you switch the Rails version information in the environment.rb? If this is the case, you’ll also need to update the configuration file by doing the following in the root of your rails application:

rake rails:update

Otherwise, please provide more detail as to what steps you performed to do the migration from Rails X to Rails 2.0.2.

-Conrad

Hi, I've unistalled Ruby, and reinstall everything from scracht. Ruby and gems. I created a new applicatinon, with the same name, and copied pages from models, controllers and views. (as well as plugins) After that, I modified every piece of code that was deprecated. Everything is working perfect, except Ajax effects. Thanks a lot. Franklin.

I realized I've migrated my forms to form_for, not for remote_form_for. :-S Now is everything fine. Thanks.