shot in the dark here..but,
I've seen this error before when there is a 'null' in the database
field for a foreign key attribute.
Does your table users? ...
has_many :roles
has_many aliases
has_many :addresses
if so...
Try looking at your model associations or database relationships,
perhaps the problem is a 'null' in the user table at one of these
fields:
:role_id,
:alias_id,
:address_id
...that is being called in a virtual column, to_label or other method
somewhere...
ex.(will cause error)
def role_item
user.role.items
end
coalex.
On Nov 12, 3:19 pm, "venkat veerla" <[EMAIL PROTECTED]> wrote:
> hi,
> When i am trying to render the data from the table i am getting the
> following error
>
> Action Controller: Exception caught
>
> You have a nil object when you didn't expect it!
> The error occurred while evaluating nil.items
>
> app/views/categories/_list.rhtml:13:in
> `_run_erb_47app47views47categories47_list46rhtml'
> app/views/categories/index.html.erb:9:in
> `_run_erb_47app47views47categories47index46html46erb'
> app/controllers/categories_controller.rb:18:in `index'
> :1:in `initialize'
>
> please help me in this
>
> On Tue, Nov 11, 2008 at 9:42 PM, G. Sobrinho <[EMAIL PROTECTED]>wrote:
>
> > Please, post your AS version, Rails version and Ruby version
>
> > venkat veerla escreveu:
>
> > class UsersController < ApplicationController
>
> > layout "activescaffold"
>
> > active_scaffold :user do |config|
> > config.columns = [:id, :name, :photo, :first_name, :middle_name,
> > :last_name, :phone_number, :email_address,
> > :login, :password, :roles, :aliases, :addresses]
>
> > config.columns[:phone_number].description = "(Format: ###-###-####)"
> > config.columns[:phone_number].label = "Phone"
>
> > config.create.columns.exclude :id, :name
> > config.update.columns.exclude :id, :name
> > config.list.columns.exclude :first_name, :middle_name, :last_name,
> > :password, :phone_number
> > config.subform.columns = [:first_name, :last_name, :login, :password]
>
> > config.list.sorting = {:login => 'ASC'}
>
> > config.nested.add_link "Names", [:aliases]
>
> > config.create.columns.exclude(:first_name, :middle_name, :last_name,
> > :phone_number)
> > config.create.columns.add_subgroup "Personal Data" do |group|
> > group.add(:first_name, :middle_name, :last_name, :phone_number)
> > end
> > end
> > end
>
> > this is my controller
>
> > On Tue, Nov 11, 2008 at 5:01 PM, G. Sobrinho <[EMAIL PROTECTED]>wrote:
>
> >> This error is about you try to set label, or other property, in a
> >> inexistent column.
>
> >> Please, post your controller
>
> >> Pandu escreveu:
> >> > Hi All,
> >> > I am using Active Scaffold plug in in rails. I am able to
> >> > create a form and i am able to display the labels.
> >> > But while we displaying the content it is giving the following
> >> > problem.
>
> >> > Called id for nil, which would mistakenly be 4 -- if you really wanted
> >> > the id of nil, use object_id
>
> >> > and following errors
>
> >> > You have a nil object when you didn't expect it!
> >> > The error occurred while evaluating nil.items
>
> >> > vendor/plugins/active_scaffold/frontends/default/views/_list.rhtml:
> >> > 13:in
>
> >> `_run_erb_47vendor47plugins47active_scaffold47frontends47default47views47_list46rhtml'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/base.rb:637:in
> >> > `compile_and_render_template'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/base.rb:331:in `render'
> >> > vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:
> >> > 60:in `render_with_active_scaffold'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/partials.rb:117:in `render_partial'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_controller/benchmarking.rb:26:in
> >> > `benchmark'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/1.8/
> >> > benchmark.rb:293:in `measure'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/1.8/
> >> > benchmark.rb:307:in `realtime'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_controller/benchmarking.rb:26:in
> >> > `benchmark'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/partials.rb:116:in `render_partial'
> >> > vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:
> >> > 70:in `render_partial_with_active_scaffold'
> >> > C:/Program Files/NetBeans 6.1/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/
> >> > actionpack-2.0.2/lib/action_view/base.rb:352:in `render'
> >> > vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:
> >> > 60:in `render_with_active_scaffold'
> >> > app/views/users/index.html.erb:10:in
> >> > `_run_erb_47app47views47users47index46html46erb'
> >> > app/controllers/users_controller.rb:55:in `index'
> >> > :1:in `initialize'
>
> >> > Please help me... Thanks in Advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---