Erector views – undefined method `default_url_options’

admin ·

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

What can we help you with?

Tell us a bit about your project, or just shoot us an email.

Interested in a Career at Carbon Five? Check out our job openings.