API Tips – Removing HTML From String in Model/Controller
strip_tags method really comes in handy when you have to render out a string in DB. However, what if you have to return that from a controller or a model, which is often the case when you’re developing an API.
In Rails, here’s a simple way to do it.
> HTML::FullSanitizer.new.sanitize("<b>Hope</b> <a href='whatever'>my link</a>")
=> "Hope my link"
My Project Management Tool
Few years ago, I was interviewing for a development manager position and was asked what tools I use to manage my projects. I told the interviewer that I use Mind Manager and mind mapping to effectively manage my projects. He looked at me like a deer in headlights and asked why not use a spreadsheet? I explained why but was told that I had to use a spreadsheet. Needless to say, I didn’t get that job.
Rather than go into details about how I do it here, take a look at this video from Mindjet, the maker of Mind Manager. I’ve been doing similar for years, but the tool now makes it much easier.
Upgrading Ruby in RVM
Screencast on simple way to upgrade existing Ruby in RVM.
Upgrading Ruby in RVM from Joon You on Vimeo.
Service-Oriented Design with Ruby and Rails
Paul Dix wrote a book titled “Service-Oriented Design with Ruby and Rails” and it’s available on Amazon at here. The book is also available on Safari, so check it out if you’re interested in developing API’s.
I’ve been working with SOA for years now and developed couple of API’s using both Rails and Sinatra. The book appears to cover both of them. I have not read the book cover to cover, but only glanced at certain sections. However, based on the sections I read, the book appears to be a good one.