[Radiant] Page saving error
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. ps. I apologize for my poor English. 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/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms' F:/Work/Ruby187/p302/lib/ruby/1.8/benchmark.rb:308:in `realtime' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/flash.rb:151:in `perform_action' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/base.rb:532:in `send' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/base.rb:532:in `process_without_filters' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/filters.rb:606:in `sass_old_process' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/ plugins/haml/lib/sass/plugin/rails.rb:20:in `process' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/base.rb:391:in `process' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/base.rb:386:in `call' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
Re: [Radiant] Re: Re: best code syntax highlighting solution
Looks like coderay is working well. I installed: coderay gem + radiant extension @ https://github.com/phallstrom/code_ray and now I can specify r:code blocks! not sure what the benefits are of kramdown over the existing Markdown radiant filter that comes with the Coffee blog template. If you guys can shed some light on why kramdown is a better option I'd appreciate it. Thanks again! Fima
Re: [Radiant] Re: Re: best code syntax highlighting solution
On Mon, Dec 13, 2010 at 8:56 AM, Fima Leshinsky flesh...@gmail.com wrote: Looks like coderay is working well. I installed: coderay gem + radiant extension @ https://github.com/phallstrom/code_ray and now I can specify r:code blocks! not sure what the benefits are of kramdown over the existing Markdown radiant filter that comes with the Coffee blog template. If you guys can shed some light on why kramdown is a better option I'd appreciate it. it's not better. it's the same but with kramdown specific options enabled.
Re: [Radiant] Page saving error
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/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/ activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms' F:/Work/Ruby187/p302/lib/ruby/1.8/benchmark.rb:308:in `realtime' F:/Work/Rails/Radiant/dev_version/test_app/vendor/radiant/vendor/rails/
[Radiant] Re: Page saving error
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 w...@spanner.org 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/vendor/radiant/vendor/rails/ actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
[Radiant] Partials access to local objects
I'm writing an extension to add a new feature to the taggable extension and I need to do something very simple: add a new column to the taggable index page. This is pretty simple: admin.tag.index.add :thead, add_required_header, :after = modify_header admin.tag.index.add :tbody, add_required_cell, :after = modify_cell However, in my partial, I need to reference the tag object from index.html.haml: - for tag in @tags %tr.node.level-1 - render_region :tbody do |tbody| . . . / Partial code should be inserted here / - tbody.required_cell do / - if tag.required / Required However, the tag object is not available within the partial. Is there any way I can get access to that when I'm adding code via partials?
Re: [Radiant] Partials access to local objects
On 13 Dec 2010, at 19:05, bradley.t.her...@gmail.com wrote: I'm writing an extension to add a new feature to the taggable extension and I need to do something very simple: add a new column to the taggable index page. This is pretty simple: admin.tag.index.add :thead, add_required_header, :after = modify_header admin.tag.index.add :tbody, add_required_cell, :after = modify_cell However, in my partial, I need to reference the tag object from index.html.haml: - for tag in @tags %tr.node.level-1 - render_region :tbody do |tbody| . . . / Partial code should be inserted here / - tbody.required_cell do / - if tag.required / Required However, the tag object is not available within the partial. Is there any way I can get access to that when I'm adding code via partials? No. It's a weakness of the otherwise very cunning shards mechanism that there is no way for it to get at local variables. Taggable could help, perhaps by including an empty partial (_other_columns.html.haml?) with some locals or by setting a @current_tag variable within the index-page loop. Neither approach is very pleasing, but it will take a while to arrive at a better solution that is also simple enough to live with. I need to clear up that index page anyway (as you can see from the 'node.level-1'). Would anyone like to suggest a best practice here? will
[Radiant] Archive index infinite loop
Hi all, I have the standard issue Articles:Archive Monthly Index with four child pages but I'm getting an infinite application loop when getting a monthly index. I have to reboot my server whenever this happens. I've attached a log snippet (with just the head of the infinite loop) and a screen shot of my pages hierarchy. The only thing I can figure out is that my monthly-archives page is published in the same month as my child pages, so when I do an archive search, the SQL statement pulls in the archive index page. So I changed the published date to a year earlier and it worked, no infinite loop. Yay! Is this a known issue? Or should the archive index pages not be marked as published? What did I do wrong? Sorry if this is a newbie question. Thanks for any advice, Kevin Attachments: http://www.ruby-forum.com/attachment/5545/archive_index_log.txt http://www.ruby-forum.com/attachment/5546/Screen_shot_2010-12-14_at_12.49.50_AM.png -- Posted via http://www.ruby-forum.com/.
[Radiant] Re: Radiant 9.0.1 hangs up after a while, and how i store forminputs in mysqldatabase
# Configuration: - Apache/2.2.8 (Ubuntu) - Phusion Passenger version 3.0.0 - Rails 3.0.3 - Ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] - WEBrick 1.3.1 - gem 1.3.7 # Problem 1 - Server hangs up after a while: When i start my radiant with this command: script/server -e production my cms will run nearly 2 hours and after this time it keeps to be hang up. I'm not sure script/server is the way to run your webserver. I think that starts WEBrick, which is not an ideal choice for production webserver. There should be a site configuration file for apache that points to your application's public directory. Let me know if you have that configuration file -- if not, I'll send you a sample configuration file. # Problem 1 - Store userinputs from webformular in MYSQL Database How it is possible - to send formularinputs to a phpscript that stores this values in my database? Do you mean you have a PHP script that receives the form input and needs to store the input into the database? -- Posted via http://www.ruby-forum.com/.