«« Next » « Previous
«« Next » « Previous

Link Details

Link 81448 thumbnail
User 111696 avatar

By bloid
via blogs.pathf.com
Submitted: May 17 2008 / 04:16

I just did something in a Rails project that made me very happy -- I wrote a lot of helper methods. I had a whole mess of ERb managing an index page with pagination, sorting, quick search, and so on, all of which was going to need to be more or less duplicated for several controllers. This promised to be annoying, so I started to push some of the HTML/ERb code up to helper methods with an eye toward reusing them. Eventually, I was able to convert the whole thing to a series of helper methods -- the view page is just a single line calling the top-level helper methods. And I smiled.
  • 4
  • 1
  • 175
  • 22

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (4)



Voters Against This Link (1)