Erector views – undefined method `default_url_options’

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

This entry was posted in Web and tagged . Bookmark the permalink.

2 Responses to Erector views – undefined method `default_url_options’

  1. Ralf Nieuwenhuijsen says:

    You just saved my day!
    Thanks :-)

  2. kirill says:

    I owe you a beer

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>