
problem with content_for_assignments rails extension
Reported by Micah Geisel | August 4th, 2009 @ 12:25 AM
after installing adva into a basic rails app, i generated the following error:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.select
Extracted source (around line #13):
10:
11: = stylesheet_link_merged :base
12: = yield :css
13:
14: /[if IE]
15: = stylesheet_link_merged :ie
16:
RAILS_ROOT: /home/micah/work/rumsey
Application Trace | Framework Trace | Full Trace
/home/micah/work/rumsey/vendor/plugins/adva_cms/lib/rails_ext/action_controller/content_for_assignments.rb:31:in `content_assignments_proc'
/home/micah/work/rumsey/app/views/layouts/application.html.haml:13:in `_run_haml_app47views47layouts47application46html46haml'
to get around this, i had to do the following to engines/adva_cms/lib/rails_ext/action_controller/content_for_assignments.rb. i dont fully understand the intent of all this, so i could only hack around it.
@@ -28,11 +28,13 @@ end
ActionView::Renderable.module_eval do
def content_assignments_proc_with_content_for_filters(view)
Proc.new do |*names|
- contents = view.controller.registered_contents.select { |id, content| content.target == names.first }
- contents.each do |id, content|
- # content_for always appends the new content. we might want to have
- # more finegrained control over that.
- view.content_for(names.first, content.render(view))
+ if view.controller.registered_contents
+ contents = view.controller.registered_contents.select { |id, content| content.target == names.first }
+ contents.each do |id, content|
+ # content_for always appends the new content. we might want to have
+ # more finegrained control over that.
+ view.content_for(names.first, content.render(view))
+ end
end
content_assignments_proc_without_content_for_filters(view).call(*names)
end
i have several gems and plugins installed, and this only happens on the first load of the rails framework. if i refresh, the error does not reoccur, so i suspect its some sort of loading order issue. if it helps, these are the plugins and gems i have installed:
acts_as_list
adva_activity
adva_blog
adva_cells
adva_cms
adva_comments
adva_rbac
adva_user
asset_packager
cucumber_rails_debug
exception_notification
input_css
config.gem 'faker'
config.gem 'notahat-machinist', :lib => 'machinist', :source => 'http://gems.github.com'
config.gem 'bmabey-email_spec', :lib => 'email_spec', :source => 'http://gems.github.com'
config.gem 'cucumber', :lib => false
config.gem 'webrat', :lib => false
config.gem 'rspec-rails', :lib => false
config.gem 'rspec', :lib => false
config.gem 'giraffesoft-resource_controller', :lib => 'resource_controller', :source => 'http://gems.github.com'
config.gem 'chriseppstein-compass', :lib => 'compass', :source => 'http://gems.github.com', :version => '>=0.8.6'
config.gem 'haml', :version => '>=2.2'
what can i do to help track down the cause of this bug?
Comments and changes to this ticket
-
Marko Seppä August 4th, 2009 @ 10:08 AM
- State changed from new to open
Hi Micah,
Thanks for the report!
Just added this to our product icebox.-- Marko
-
Marko Seppä August 13th, 2009 @ 03:49 PM
Hi Micah,
first I thought this error might be caused by your use of haml, but after installing and overriding the default layout with haml I did not get any error.
The method you are hacking there is for registered content, meaning you can add content to your views from controller. Like
content_for(:sidebar, :foo, :except => { :action => :show }) { 'foo' } # registered content
Problem is that I cannot reproduce the error you are having.
-
EDiggs October 26th, 2020 @ 08:35 AM
Light House is a website that needs to make an account first to get information from it. You can add your art web designs from given list. Must you can check Resume Writing Services and get to learn more new techniques about the writing service. They are offering tickets details as well from which you can get to solve your problem. Join their website for more.
-
Alex February 26th, 2021 @ 08:29 AM
Get Verified Shapa Promo Code. & Shapa Coupon Code. The Shapa team consists of scientists, technologists and entrepreneurs passionate about using behavioral science to create innovative products that customers will love while also empowering them to change their behaviors, built long term healthy habits, and prevent disease. https://uttercoupons.com/front/store-profile/shapa-promo-code
-
Alex February 26th, 2021 @ 08:29 AM
Launched in January 2015, Nutaku Code is an online game portal dedicated to bringing the highest quality games to our committed fans. ... Our company provides a host of services for game developers, ranging from well-established studios to newly created startups. https://uttercoupons.com/front/store-profile/nutaku-coupons
-
Alex February 26th, 2021 @ 08:29 AM
Skyo Promotional code is an online book shop where parents and students could rent or buy cheap textbooks thus saving more on book costs. Over 5 million book titles from a variety of categories are available here in hardcopy or digital format, brand new or used copies. https://uttercoupons.com/front/store-profile/skyo-coupons
-
Alex February 26th, 2021 @ 08:29 AM
"Rule the kitchen" and master the art of deal hunting with Ninja Kitchen coupon codes. Ninja Kitchen crafts the tools you need to whip up smoothies, rock roasts and much more. https://www.uttercoupons.com/front/store-profile/ninja-kitchen-coupons
-
Alex February 26th, 2021 @ 08:29 AM
Fairweather Coupons code helps you save on coupon and promo codes. https://uttercoupons.com/front/store-profile/fairweather-coupons
-
jarsip October 25th, 2021 @ 10:13 AM
Glucofort is an advanced blood sugar support formula that eliminates the root cause of type 2 diabetes. https://glucofort.me
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>
<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>
<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>