Mic*_*ant 1 haml ruby-on-rails
我有这个rails视图部分,我只是看不到问题:
%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)
Run Code Online (Sandbox Code Playgroud)
但我一直在接受:
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):
...
Run Code Online (Sandbox Code Playgroud)
这意味着你试图在-运算符上调用nil.可能这些---------------------行被解释为一个代码行,这是一个减号链,这是令人困惑的事情.尝试\---------------------改为做.
| 归档时间: |
|
| 查看次数: |
224 次 |
| 最近记录: |