Results 1 to 5 of 5
May 20, 2009, 05:56 #1
- Join Date
- Dec 2004
- 0 Post(s)
- 0 Thread(s)
can i return multiple values from helper method?
So I'm trying to clean up my views, removing logic and such.
Here's what I currently have
<% if counter == 7 -%><% counter = 0 -%></tr><tr><% end -%>
And here's my attempt at a helper
def week_row_end(counter) if counter == 7 counter = 0 row_end = "</tr><tr>" else counter += 1 end end
which works…*but only once. The counter being set back to 0 isn't getting sent because the row_end is instead (since it's the last one, correct?). SO, in this instance, is it just necessary to have logic in the view sometimes?
By the way, the goal here is to end a row for a calendar and start a new one.your brain reacts in the same way whether you are
looking at something or thinking about it...