1

I have this rails view partial and I just can't see the issue:

%span{class: "show_hide #{show_hide}"}
  ---------------------
  = first_field_focus
  ---------------------
  - if first_field_focus == "1" 
    - puts '++++++++++++'
    - puts 'y' 
    - puts '.............'
    - puts '.............'
    - puts '==='
  %a{href: '#', :data => {toggle_description_length: 'toggle'}} # Line 11
    = raw(txt)

but I just keep getting:

NoMethodError in Links#index

Showing /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_toggle_details_link_bold.html.haml where line #11 raised:

undefined method `-@' for nil:NilClass

Extracted source (around line #11):
...
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

1 Answers1

5

It means you're trying to call the - operator on something that is nil. Probably those --------------------- lines are being interpreted as a code line that's a chain of minus signs and it's confusing things. Try making it \--------------------- instead.

Chuck
  • 234,037
  • 30
  • 302
  • 389