Professional Goals for 2009
Posted: December 31, 2008 Filed under: General Leave a comment »So I’ve seeing a lot of people writing on their blogs about their general goals for the upcoming year. So I thought for the purpose of reminding myself every time I came here I would write mine up as well.
- Continue my work/learning Ruby and Rails
- Go back to learning C
- Learn Objective-C
- Continue my business/executive training
- Blog more of course
- Continue advancing my knowledge of Agile methodologies
- See team camaraderie at my day job increase
- Really start following TDD/BDD principles
So with that in mind… HAPPY NEW YEAR!
Optimizing the RedCloth Helper
Posted: December 1, 2008 Filed under: Programming | Tags: Ruby, Ruby on Rails Leave a comment »In my previous post I posted several small Rails tips, one of which was a cleaner RedCloth helper. Unfortunately, this helper requires that the textile is parsed each time the page is loaded, and that can get nasty. So it our item is a text field called details, just add a details_html field to your model… then create a private conversion method that you call using a before_filter.
Something like:
before_filter :convert_details def convert_details return if self.details.nil? self.details_html = RedCloth.new(self.details).to_html end
Then just display details_html in your view instead. This way the textile only gets converted when you save and make changes to it.