That was 7 years ago and looking back at the code now I cringe. Sometime in between there and now it was upgraded to php4 and it looks like that was a hack of a job. But since then my php life has expanded to the point of it no longer being a challenge. So what else would be a better way to start my Rails life than to revisit my dads billing application and recreate it with rails. Of course fixing all the issues with the current billing process and adding some additional features to make life easier.
Coming from php which is mainly mirrored from C++ I have always been use to the long hand conditionals. One thing that rails offers is the "unless" command. Compacting an if statement into one line that can be read without much difficulty. Here is an example of its use, probably not the most efficient but I am sure it will get tweaked once more come into play.
<%= ' class="selected"' unless controller.controller_name != 'customer' %>
Blogged with Flock
No comments:
Post a Comment