haywood
unread,May 30, 2011, 5:37:53 PM5/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to middleman-users
When I start up my mm-server and try to load the index page, or any
subsequent page I get slapped with this error
NoMethodError at /
undefined method `[]' for nil:NilClass
file: rendering.rb location: render line: 130
Backtrace (expand)
/Users/ryanhaywood/Desktop/web/middleman/portfolio/views/layout.haml
in evaluate_source
= partial 'footer'
This is the code for my helper function
helpers do
def partial(path, *locals)
pieces = path.split('/')
partial = '_' + pieces.pop
locals = locals.empty? ? nil : locals[0]
render(File.join(pieces.join('/'), partial), partial = true, locals)
end
end
I include it with haml like this
= partial 'footer'
The error goes away if I change the functions name, like from partial
to render_partial. I can then refresh the page and all works well,
partials are included throughout the site. But if I restart the
server, I get the same initial error, but again it goes away with a
function name change.
I also can not locate the "rendering.rb" file on my machine.
Any help is appreciated. Thanks!