アプリケーション全体のviewファイルをhaml化している途中なのですが、テーマのエラーが発生してしまいました。
現在のコード
●application.html.haml
- unless flash.empty? :javascript <haml_silent> flash.each do |f| </haml_silent><haml_block><haml_silent> type = f[0].to_s.gsub('alert','error').gsub('notice','info') </haml_silent> toastr['#{type}']('#{f[1]}'); </haml_block>
問題の箇所は下記です。
type = f[0].to_s.gsub('alert','error').gsub('notice','info')
</haml_silent> toastr'#{type}';
元のコード
●application.html.erb
<% unless flash.empty? %> <script type="text/javascript"> <% flash.each do |f| %> <% type = f[0].to_s.gsub('alert','error').gsub('notice','info') %> toastr['<%= type %>']('<%= f[1] %>'); <% end %> </script> <% end %>
どこをどのように修正すれば良いか、お分かりになる方がいらっしゃいましたら教えて頂けますでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/10 11:10 編集
2018/08/10 13:24
2018/08/10 18:03
2018/08/11 03:30