views:

81

answers:

1

NoMethodError in course_templates#index

Showing app/views/course_templates/index.haml where line #6 raised:

undefined method `new_course_template' for #<ActionView::Base:0x237c3e4>

Extracted source (around line #6):

3: - content_for :sidebar do  
4:   %ul.links  
5:     %li= link_to "Add a Template", new_course_template(@provider)  
6:   
7: - content_for :main do  
8:     = page_entries_info @templates  
9:

See it says "around line #6", and the error is on line 5. This example isn't too bad...but errors in more complex views or in helpers are almost impossible to find right away. Is there a configuration that I'm missing?

+1  A: 

This is a bug that I believe should be fixed in the soon-to-be-released Haml 2.2.11. If you wouldn't mind trying this out with the Haml stable branch to see if that makes the line number correct, I would appreciate it greatly.

nex3
I tried with Haml 2.2.12, and the line numbers are still off. But they seem to be right on when I remove the `content_for`...maybe that's a hint.
Jonathan Julian
Could you provide me with the complete source code for the template? You seem to have caught a bug that I'd like very much to fix.
nex3
nex3 is working on this. My research shows that any `content_for` whether before or after the rest of the content, causes the line numbers to be incorrect.
Jonathan Julian
I think this was a PEBKAC. Haml 2.2.12 error reporting looks good.
Jonathan Julian