If you are running a rails app on Windows Server (GASP) then you will run into the problem of how to restart your apps?

Read the rest of this entry

When you are coding, you should try to separate out the things that change from the things that stay the same. This isn’t my idea, but it is worth tip’n here as I just saw a really good, simple example of this…

Read the rest of this entry

This has been said a lot, and doesn’t really need repeating by someone like me, but, as this is a tips page, I should put it here.

Read the rest of this entry

Tip #26 - Start Small

2008-06-24 07:22:38 +0000

If you are getting frustrated with RSpec, then you have probably skipped a gradient. Start smaller!

Read the rest of this entry

Tip #25 - Logging is your friend...

2008-06-24 07:18:17 +0000

Sometimes when you need someone to just look over your code and figure out what the heck is going on, you can turn to your best coding friend, this friend sits away in the log directory carefully collecting data waiting for your beck and call…

Read the rest of this entry

This tip is coming to you from a frustrated developer having to read someone else’s specs….

Read the rest of this entry

Tip #23 - Know your fundamentals

2008-06-20 16:15:31 +0000

You would expect any professional to know their stuff, for a Ruby on Rails beginner, this is no less important.

Read the rest of this entry

This tip actually applies to every open source project out there… it is, how do you ask a question that will get you the maximum chance of a good answer?

Read the rest of this entry

Tip #21 - Developer Info On Every Page

2008-06-02 07:37:55 +0000

When you are making a rails site, you sometimes need to get to the session hash or the params hash and see just what got sent back to the browser, but going in, editing the template and reloading is just a PITA, here is a quick tip that can help you have that (and any other) information no more than a click away, at any time, and any view….

Read the rest of this entry

Tip #20 - Subscribe to Rails Envy

2008-05-26 20:02:10 +0000

Even though they got my name wrong :) Gregg Poolak and Jason Seinfield have a fantastic podcast that you all should subscribe to.

Read the rest of this entry

Tip #19 - Raaums Hints Rock

2008-05-26 19:50:16 +0000

When I was learning Ruby on Rails, this site by Raaum was a god send.

Read the rest of this entry

Tip #18 - Take Back Your App Folder!

2008-05-17 17:14:13 +0000

Contrary to popular (?) belief, your app folder’s content is not restricted to models, controllers, helpers and views. You can through some other stuff in there as well!

Read the rest of this entry

Tip #17 - Struct Your Stuff!

2008-05-12 17:31:38 +0000

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 entry

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 entry

Tip #15 - Read Other People's Code

2008-04-25 20:56:42 +0000

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 entry

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 entry

Tip #13 - BangBang Transformations!

2008-04-22 18:02:21 +0000

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 entry

Tip #12 - HTML and HTTP are Your Friends

2008-04-20 07:26:31 +0000

What is an <em> tag? How do you manually make a select box? What about a multi value select box? Do you know the difference between a <submit> tag and a <button> tag? Can you hand code a form to make a restful post to one of your Rails controllers? If you can’t do all the above with plain HTML and no rails helpers or don’t know the difference between a GET and POST request and when you use either, then you need to read on. If you can, feel free to skip to the next section.

Read the rest of this entry

Tip #11 - Transact Your Migrations!

2008-04-17 10:23:10 +0000

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 entry

Tip #10 - The Ruby Language

2008-04-17 07:40:40 +0000

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 entry

Tip #9 - Learn Programming Theory

2008-04-16 13:18:55 +0000

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 entry

Tip #8 - Must Know Facets of Ruby on Rails

2008-04-16 12:38:59 +0000

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 entry

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 entry

So, 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 entry

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 entry

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 entry

Tip #3 - Sexy Date Select Fields!

2008-04-12 11:31:45 +0000

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 entry

Tip #2 - Daemonize Your Gems!

2008-04-11 21:15:24 +0000

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

Tip #1 - Subscribe to the Railscasts

2008-04-10 11:09:06 +0000

After watching Ryan’s 100th episode with the special duck typing sound effect at the start, he mentions a competition for the whole Ruby on Rails community. So here is my first tip!

Read the rest of this entry