I have a variable $foo defined in my SCSS/SASS file. I want to be able to also access $foo (as a constant) in my model file, 'bar-model.rb'. How can I do this?
Asked
Active
Viewed 107 times
-1
-
your question little messy can u clean up ? – 7urkm3n Apr 04 '16 at 18:37
1 Answers
0
Perhaps you could:
- use data attributes (e.g.
<div data-images-per-row="<%= @images_per_row %>"></div>
and access it via Javascript
However, this doesn't "feel" right to me. Maybe you are looking for something like in_groups_of
?
<table>
<% @tasks.in_groups_of(4, false) do |row_tasks| %>
<tr>
<% for task in row_tasks %>
<td><%= image_tag task.image %></td>
<% end %>
</tr>
<% end %>
</table>

Daniel Olivares
- 544
- 4
- 13