Files
2012-02-21 01:15:00 -05:00

1 line
2.4 KiB
JSON

[{"user_id": 41582, "stars": [], "topic_id": 45835, "date_created": 1317151345.631767, "message": "Where can we learn ERb for Middelman, what\u2019s the best resource ?", "group_id": 10410, "id": 2227158}, {"user_id": 7586, "stars": [], "topic_id": 45835, "date_created": 1317152293.245028, "message": "However, the only line you really need to start is <%= yield %> in your layout which injects the contents of your page (index.html.erb) into that spot.", "group_id": 10410, "id": 2227271}, {"user_id": 7586, "stars": [], "topic_id": 45835, "date_created": 1317152260.2907071, "message": "Probably any Rails/Ruby book will cover it, it's their default templating language as well. It's also very similar to PHP's syntax or ASP.", "group_id": 10410, "id": 2227267}, {"user_id": 39411, "stars": [], "topic_id": 45835, "date_created": 1317155543.614789, "message": "It all depends on what background your from but if you've used any lightweight templating language before then it all follows suit. It's just the syntax that differs. The basic patterns are no more than:", "group_id": 10410, "id": 2227561}, {"user_id": 39411, "stars": [], "topic_id": 45835, "date_created": 1317155663.9551001, "message": "That's pretty much all you need to get started. And as tdreyno noted it will mostly be used in the form of <%= yield %> in your layouts and the odd partial inclusion.", "group_id": 10410, "id": 2227569}, {"user_id": 39411, "stars": [], "topic_id": 45835, "date_created": 1317155552.336062, "message": "<% \"ERB will evaluate this\" %>\n<%= \"ERB will evaluate and output this\" %>\n<%# \"ERB will ignore this (useful for testing)\" %>", "group_id": 10410, "id": 2227562}, {"user_id": 41582, "stars": [], "topic_id": 45835, "date_created": 1317157885.302582, "message": "ok but in the website examples there are some examples with \n<ul>\n <% 5.times do |num| %>\n <li>Count <%= num %>\n <% end %>\n</ul>\n\nSo It may be useful to learn loop", "group_id": 10410, "id": 2227725}, {"user_id": 7586, "stars": [], "topic_id": 45835, "date_created": 1317187469.9362299, "message": "Since the primary purpose of Middleman is static sites, loops are basically just a convenience for throwing in a bunch of example or Lorem paragraphs. Nothing that can't be solved by a little copy & paste. That said, it never hurts to learn. ERb constructs (if, loops, etc) are just plain Ruby,", "group_id": 10410, "id": 2230478}]