jb icon indicating copy to clipboard operation
jb copied to clipboard

got ActionView::SyntaxErrorInTemplate error

Open xgrei opened this issue 4 years ago • 1 comments

# Gemfile
gem 'jb', '~> 0.7.1'
ActionView::SyntaxErrorInTemplate (Encountered a syntax error while rendering template: check
16:58:04 backend.1  | @posts.map do |post|
16:58:04 backend.1  |   {
16:58:04 backend.1  |     title: post.title
16:58:04 backend.1  |   }
16:58:04 backend.1  | end

16:58:04 backend.1  | app/views/api/posts/latest.json.jb:5: syntax error, unexpected tIDENTIFIER, expecting '}'
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:6: syntax error, unexpected ':', expecting end
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:7: syntax error, unexpected ':', expecting end
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:8: syntax error, unexpected ':', expecting end

rails: 6.0.2.2 ruby: 2.6.6

xgrei avatar May 07 '20 10:05 xgrei

It seems a ruby syntax error, you can lint your file using rubocop or another tool to help

prem-prakash avatar May 16 '20 22:05 prem-prakash