Many thanks!! Your advice solved my problem. Page_fields extension use
that method. I've prepended it as you suggested, and now all work
perfectly.
On 14 дек, 01:19, William Ross wrote:
> On 13 Dec 2010, at 09:01, rcz wrote:
>
> > In Radiant CMS when I'm trying to save any page that has any PageType
> > but "normal" (Archive, Index,etc.) I get this error:
>
> > NoMethodError in Admin/pagesController#update
>
> > undefined method `[]' for nil:NilClass
>
> > With clean Radiant everything's work, my radiant carried with some
> > extension, which may cause problem. Can anyone give me any clue how
> > can I solve this problem? Thanks.
>
> It is an extension problem. It should be easy to find and you can probably
> eliminate it by changing the order in which the extensions load.
>
> I think one of your extensions is calling
> Page.accepts_nested_attributes(:something) too late. Some Page subclasses
> have already been created, and they don't get the call. When you try to save
> a page with one of those classes (ArchivePage, etc) it doesn't know what to
> do with the nested attributes in the form. The error you see is due to an
> absence of nested_attributes_options.
>
> First you need to work out which of your extensions is responsible. There are
> two ways to do that: either add some debugging lines to
> vendor/radiant/vendor/rails/
> activerecord/lib/active_record/nested_attributes.rb or (more easily), search
> through all the files in vendor/extensions looking for the string
> accepts_nested_attributes and see what stands out.
>
> Then you need to make sure that troublesome extension loads before there is
> any inheritance from Page. To do that you uncomment this line in
> config/environment.rb:
>
> # config.extensions = [ :all ]
>
> and prepend the name of your extension:
>
> config.extensions = [:something, :all]
>
> > ps. I apologize for my poor English.
>
> Your English seems excellent to me. Please do say if anything here is unclear.
>
> best,
>
> will
>
>
>
>
>
> > stack trace:
>
> > NoMethodError in Admin/pagesController#update
>
> > undefined method `[]' for nil:NilClass
>
> > RAILS_ROOT: F:/Work/Rails/Radiant/dev_version/test_app
> > Application Trace | Framework Trace | Full Trace
>
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/nested_attributes.rb:335:in
> > `assign_nested_attributes_for_collection_association'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/nested_attributes.rb:244:in
> > `fields_attributes='
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2906:in `send'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2906:in `assign_attributes'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2902:in `each'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2902:in `assign_attributes'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2775:in `attributes='
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > activerecord/lib/active_record/base.rb:2669:in `update_attributes!'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/app/
> > controllers/admin/resource_controller.rb:64:in `update'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/base.rb:1331:in `send'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/base.rb:1331:in
> > `perform_action_without_filters'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:617:in `call_filters'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:638:in
> > `run_before_filters'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:189:in `call'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:189:in `call'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:635:in
> > `run_before_filters'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:615:in `call_filters'
> > F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
> > actionpack/lib/action_controller/filters.rb:610:in
> > `perform_action_without_benchmark'
> > F:/Work/Rails/Radiant/dev_version/test_app/ve