working on a rails app that doesn't seem to want to run 'Until' or 'While' functions. Having to do the following:
<% if q == 2 or q == 5 or q == 8 or q == 11 or q == 14 or q == 17 or q ==20 %>
Any suggestions for how I can improve this?
working on a rails app that doesn't seem to want to run 'Until' or 'While' functions. Having to do the following:
Any suggestions for how I can improve this? |
|||
Questions on Code Review - Stack Exchange are expected to relate to code review request within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.
If you really want to test these specific numbers, you could try
|
|||
|
(2..20).step(3) do ... end
– Flambino Dec 11 '12 at 22:22