views:

366

answers:

3

Hi guy,

I update my rails application 2.0.2 to 2.3.5. I use active scaffold for the administration part.

I change nothing in my code but a problem is coming with the update. I have a controller 'admin/user_controller' to manage users.

Here is the code of the controller:

    class Admin::UserController < ApplicationController

  layout 'admin'

  active_scaffold :user do |config|
    config.columns.exclude :content, :historique_content, :user_has_objet, :user_has_arme, :user_has_entrainement, :user_has_mission, :mp, :pvp, :user_salt, :tchat, :notoriete_by_pvp, :invitation
    config.list.columns = [:user_login, :user_niveau, :user_mail, :user_bloc, :user_valide, :group_id] #:user_description, :race, :group, :user_lastvisited, :user_nextaction, :user_combats_gagner, :user_combats_perdu, :user_combats_nul, :user_password, :user_salt, :user_combats, :user_experience, :user_mana, :user_vie
    config.create.link.page = true
    config.update.link.page = true
    config.create.columns.add :password, :password_confirmation
    config.update.columns.add :password, :password_confirmation
    config.create.columns.exclude :user_password, :user_salt
    config.update.columns.exclude :user_password, :user_salt
    config.list.sorting = {:user_login => 'ASC'}
    config.subform.columns = []
  end
end

This code hasn't change with the update, but when I go in this page, I got this error:

    uninitialized constant Users

/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in `constantize'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `constantize'
/Users/Kiva/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb:28:in `reverse_matches_for'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb:24:in `each'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb:24:in `reverse_matches_for'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb:11:in `reverse'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/column.rb:117:in `autolink?'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold.rb:107:in `links_for_associations'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb:62:in `each'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb:62:in `each'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold.rb:106:in `links_for_associations'
/Users/Kiva/Documents/Projet-rpg/jeu/vendor/plugins/active_scaffold/lib/active_scaffold.rb:59:in `active_scaffold'
/Users/Kiva/Documents/Projet-rpg/jeu/app/controllers/admin/user_controller.rb:11

I search since 2 days but I don't find the problem, can you help me please.

+1  A: 

the naming convention in your application seems buggy

it should be:

class Admin::UsersController < ApplicationController

not UserController as it is. maybe it won't fix your problem, but it worth a try!

KARASZI István
A: 

Hmmm, it's strange to do this because the url to access is => admin/user

I have tried your solution but it's didn't work :(

I'll become crazy with this bug ^^

Kiva
A: 

Starting with Rails 2.3.x you have to install the Render Component plugin:

./script/plugin install git://github.com/ewildgoose/render_component.git -r rails-2.3

See instructions here: http://wiki.github.com/activescaffold/active_scaffold/getting-started

John