Ruby on Rails Thursday, October 8, 2015


So this works perfectly but I am not sure why and I suspect I would not get any points for being elegant. If someone can comment on this or provide a better solution I would appreciate it


  def table_elements(qualifier, count)
    if qualifier
      yield
      return ""
    else
      return ("<td></td>" * count).html_safe
    end
  end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ec6dcd37-247a-4f0e-813b-37f3e3c042ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment