Tip #17 - Struct Your Stuff!
May 13th, 2008
Ruby is a really dynamic language, and you can do a lot of cool things, one of them is a Struct (Structure) that allows you to make throw away objects that you can call methods on….
Read the rest of this entryTip #16 - Valid Models Don't Have to be Hard
May 12th, 2008
If you are using BE DE DE or TE DE DE, then you will get situations in your specs or tests where you want to be able to just create a valid model of another type to test against. This is where factories and builders come in handy.
Read the rest of this entryTip #15 - Read Other People's Code
April 26th, 2008
It is a great tip, and one I do fairly often, go download some code and read it until you understand it.
Read the rest of this entryTip #14 - Custom Error Messages in Validations
April 23rd, 2008
If you use Rails, you sometimes get a situation where the custom error messages just don’t work, here is how you can fix it…
Read the rest of this entryTip #13 - BangBang Transformations!
April 22nd, 2008
Ruby is marvelous, everything evaluates. Which means a lot of the time, you can get away with things like ‘if @user…” and just depend on the existence of the @user var. But what if you just really need a Boolean true or false? Here is a little pattern you can use to do this…
Read the rest of this entryTip #11 - Transact Your Migrations!
April 19th, 2008
If you are using Rails, you are most likely using migrations. Have you ever had a migration fail half way through? Have you ever then had to figure out how to find each change and revert it in the database? Would you like to never have to do that again? Here is how…
Read the rest of this entryTip #10 - The Ruby Language
April 18th, 2008
Learning Rails is hard enough without also facing the task of learning Ruby at the same time. Here I go over some of the must knows in Ruby so that you get some basic understanding of how to do Rails.
Read the rest of this entryTip #9 - Learn Programming Theory
April 17th, 2008
Being a Rails developer means that, yes, you too need to learn how to (gasp) program! No, seriously! Here are my tips on that subject.
Read the rest of this entryTip #8 - Must Know Facets of Ruby on Rails
April 17th, 2008
Sometimes it is easy to forget that when you take the plunge to learn something as encompassing as ruby on Rails, you forget just how MUCH you need to learn, and it can all seem a bit overwhelming at first. Here is a good way to go about learning it.
Read the rest of this entryTip #7 - Shell Shortcuts You Should Know and Love
April 17th, 2008
Face it, you use Ruby, you use Rails, you are going to use the shell, either in the console or directly, here are some shortcuts I can’t live without.
Read the rest of this entrySo, in the last two tips, I have shown how to check the format of the email and save the actual address only in the database. But how to check that the email domain name is valid? Easy!
Read the rest of this entryTip #5 - Cleaning Up an Email Address with Ruby on Rails
April 15th, 2008
So you have an email address field on a form in Rails, but how are you going to make sure that all those users enter a sane and well formatted email address? Here is a simple fix to that problem.
Read the rest of this entryTip #4 - Validating an Email Address with Ruby on Rails
April 14th, 2008
Did you know that Rails has inbuilt a strong email handling library called (ahem) TMail? I just so happen to maintain this now (Minero Aoki wrote it), but it gives you a great way to validate email addresses…
Read the rest of this entryTip #3 - Sexy Date Select Fields!
April 13th, 2008
Tired of having 5 different pick lists or spinners to set a date on your form? Me too, that’s why calendar_date_select was made, and it’s soo easy to install…
Read the rest of this entryTip #2 - Daemonize Your Gems!
April 12th, 2008
If you program in Ruby on Rails and or Ruby, you will find yourself firing up “gem server” all the time, so why not make it automatic?
Read the rest of this entry