Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix this annoying syntastic rails error

I have the following code in rails

<% @post.errors.full_messages.each do |msg| %>                                                                                                     
             <li><%= msg %></li>                                                                                                                              
<% end %>  

SyntasticCheck VIM plug in keeps displaying this error

app/views/posts/new.html.erb[Syntax: line:12 (1)]
1 app/views/posts/new.html.erb|12 warning| possibly useless use of a variable in void context

like image 443
CodeCrack Avatar asked Apr 14 '15 18:04

CodeCrack


2 Answers

If all you want is not to see these messages again:

let g:syntastic_eruby_ruby_quiet_messages =
    \ {'regex': 'possibly useless use of a variable in void context'}
like image 166
lcd047 Avatar answered Nov 04 '22 02:11

lcd047


If there is a posibility that the warning will help in the future, the best thing to do is add .to_s to the msg so it makes the warning go away but you don't filter future warnings.

like image 43
Stoic Alchemist Avatar answered Nov 04 '22 02:11

Stoic Alchemist