I have a JSON to declare in :javascript and I am not familiar with Ruby. The JSON is below:
:javascript
var collections = {
feed: [{'label': 'All', 'url': 'All', 'isSelected': false}]
};
But I want the part below in feed variable to repeat 20 times:
{'label': 'All', 'url': 'All', 'isSelected': true}
How do I do that using Ruby in Haml?
Thanks.
<%= 20.times { "{'label': 'All', 'url': 'All', 'isSelected': true}" } %>. Not tested, but you should get the point<%=. Just type=