Erector views – undefined method `default_url_options’

Posted on by in Web

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
...
end


Feedback

  Comments: 2

  1. Ralf Nieuwenhuijsen


    You just saved my day!
    Thanks :-)


  2. I owe you a beer

Your feedback