Ruby on Rails naming collisions
Well, this post merely serves as a note to myself:
Do not create an instance variable named @template
in an ActionController
or bad things will happen, such as this not very self-explanatory error:
NoMethodError (undefined method `view_paths' for #<EmailTemplate:0x7f751953fad0>): /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_load' /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_program' /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/bin/rdebug-ide:82 /var/lib/gems/1.8/bin/rdebug-ide:19:in `load' /var/lib/gems/1.8/bin/rdebug-ide:19 -e:2:in `load' -e:2