I'm using the wice-grid gem.
Their examples show the views in .erb
but I'd like to use .slim
for my project but am having trouble converting the example erb
into working slim
.
# ERB renders and works perfectly
<%= grid(@tasks_grid) do |g|
g.column do |task|
task.id
end
g.column do |task|
task.title
end
end -%>
# Converted SLIM does not render properly
- grid(@tasks_grid) do |g|
- g.column do |task|
= task.id
- g.column do |task|
= task.title
I've tried using this erb2slim converter but it outputs end
which slim
doesn't allow.
Edit: Solution (thanks to the help below!)
# Generate grid
- grid = grid(@tasks_grid) do |g|
- g.column do |task|
- task.id
- g.column do |task|
- task.title
# Render content in a safe way
= content_tag(:div, grid)