Skip to content

Instantly share code, notes, and snippets.

@maiha
Created December 26, 2008 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/40041 to your computer and use it in GitHub Desktop.
Save maiha/40041 to your computer and use it in GitHub Desktop.
# app/controllers/top.rb
class Top < Application
def index
partial "/tmp/index"
end
end
merb : worker (port 4001) ~ undefined method `[]' for nil:NilClass - (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.6.1/lib/merb-core/controller/mixins/render.rb:301:in `partial'
/data/home/maiha/merb/merbonrails-merb/app/controllers/top.rb:3:in `index'
/data/home/maiha/merb/merbonrails-merb/gems/gems/merb-action-args-1.0.6.1/lib/merb-action-args/abstract_controller.rb:40:in `__send__'
# merb-core-1.0.6.1/lib/merb-core/controller/mixins/render.rb:301
as = (opts.delete(:as) || template.match(%r[(?:.*/)?_([^\./]*)])[1]).to_sym
This is because 'template' variable doesn't contain any underscores.
*** merb-core-1.0.6.1/lib/merb-core/controller/mixins/render.rb.orig Fri Dec 26 20:08:45 2008
--- merb-core-1.0.6.1/lib/merb-core/controller/mixins/render.rb Thu Dec 25 12:29:18 2008
***************
*** 293,300 ****
template_path = File.dirname(template) / "_#{File.basename(template)}"
else
kontroller = (m = template.match(/.*(?=\/)/)) ? m[0] : controller_name
- template = "_#{File.basename(template)}"
end
# This handles no :with as well
with = [opts.delete(:with)].flatten
--- 293,300 ----
template_path = File.dirname(template) / "_#{File.basename(template)}"
else
kontroller = (m = template.match(/.*(?=\/)/)) ? m[0] : controller_name
end
+ template = "_#{File.basename(template)}"
# This handles no :with as well
with = [opts.delete(:with)].flatten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment