Erector views – undefined method `default_url_options’

Posted on by in Development

I’m posting this because it took me too long to figure this out. Hope it saves someone else some trouble. If you want to use named route helpers to generate urls in your erector widgets you need to include ActionController::UrlWriter in your class, like so:

class Views::Layouts::BasicPage < Erector::Widgets::Page
include ActionController::UrlWriter