How do you generate html outside of a view? I’m trying to use link_to
to generate html for a link.
I’ve included ActionView, ActionView::Helpers,
and ERB::Util, but the system says I’m calling url_for from a nil
I checked my user code and added code to make sure each object exists
(is not null) before trying to use it. I can’t figure out what I
might have missed,
and the error seems to be occurring deep inside the libraries.
So maybe something else isn’t getting included?
Here’s the stack trace in case that helps:
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.url_for
Application Trace | Framework Trace | Full Trace
send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/ helpers/url_helper.rb:27:inurl_for’
link_to' /usr/home/dan/progg/rails/articles/app/helpers/category_helper.rb: 25:innode_html’
children_html' /usr/home/dan/progg/rails/articles/app/helpers/category_helper.rb: 14:ineach’
children_html' /usr/home/dan/progg/rails/articles/app/helpers/category_helper.rb: 40:intree_html’