When browsing around today I saw quite a few sites talking about the Rails Best Practices presentation / talk that ihower did at the Kungfu RailsConf. Check it below, it really covers a lot of basic tips on how to clean up your code and follow some better coding practices.
Someone just released a gem that will analyze your code and check for “Best Practices” – seems promising. Check it out at GitHub here: http://github.com/flyerhzm/rails_best_practices
Just a quick tip for when you are doing nested resources….
In this example, I am building a app for a client where there is a recipient and they have many physicians. So I have a case where I have a nested resource. To keep thing DRY, I added this to my before filter where I get the recipient. This allows you to nuke the find in the show, edit, update and delete actions and retain the original use of @physician.
@recipient = Recipient.find(params[:recipient_id])
# DRYs her up a little so you don't have a find in the show,edit,update and delete actions
@physician = @recipient.physicians.find(params[:id]) if params[:id]
Don’t forget to modify your index find, change it to reflect the nested route… In my case:
@physicians = @recipient.physicians.find(:all)
Have any other useful tips? Let me know!
Put together a small list of apps I saw today that are part of the Rails Rumble 2008.
Let me know if I missed any by adding a comment. Check out http://blog.railsrumble.com/ – I am sure they will post an official list shortly.
*** The list keeps growing!
http://meetinbetween.us/ – Car pooling site
http://tunemuncher.com/ – Music artist tracking site, shows latest ablums from artists you like.
http://wurbe.r08.railsrumble.com/ – Conference organization?
http://foodferret.com/ – A service that finds the right food for you?
http://likis.r08.railsrumble.com/ – Social language learning
http://chicago.r08.railsrumble.com/ – Simple presentations
http://so2speak.net – RSS / Webservices to speach
http://wethepeople.r08.railsrumble.com/ – Political news?
http://myideadrawer.r08.railsrumble.com/ – Organize, collect, and share your projects
http://pug.r08.railsrumble.com/ – Pickup game locator
http://a8.r08.railsrumble.com/ – A solution for managing projects from proposal, through build stage, to getting paid.
http://dontsendit.r08.railsrumble.com/ – Delayed email sending?
http://maestro.r08.railsrumble.com/ – Music Create / Sharing app
http://notifly.r08.railsrumble.com/ – Easily integrate communication services into your app
http://jotlyapp.com/ – Blogging app
http://run1mile.com – A program to get your from nothing to running one mile
http://iheartgames.r08.railsrumble.com/ – A social application where you list your games and connect with your friends to play games.
http://billelle.r08.railsrumble.com – Unknown
http://greatminds.r08.railsrumble.com/ – A co-operative word game for two or more players
http://www.loveloathe.com/ – Lists of things you love and hate.
http://poolr.r08.railsrumble.com/ – Find a car pool
http://sellyourattention.r08.railsrumble.com/ – Build a potato man
http://gtd.r08.railsrumble.com/ – task / GTD app
http://twalala.com – Web based twitter client
http://hikedit.r08.railsrumble.com/ – Hiking fan site, find trails
http://stickyboard.r08.railsrumble.com/ – No idea what this is – a wall of randomness?
http://milliontagcloud.r08.railsrumble.com/ – donation app
http://osc.r08.railsrumble.com/ – Treasuring hunting w/SMS
http://foodistic.com – Track what you eat
http://www.playubetcha.com/ – online game where you can wager points on real-world events
http://storyseed.r08.railsrumble.com/ – create, publish, read and rate stories
http://citenow.r08.railsrumble.com/ – Keeps track of your citations on books, journals and websites.
http://rio.r08.railsrumble.com/ – pics of your diet (food)
http://goodbad.me/ – see all the good and bad stuff in the Twitterverse
http://inspiresme.r08.railsrumble.com/home – say who inspirse you
http://pranziamo.r08.railsrumble.com/ – Lunch recommendations
http://diedebtdie.r08.railsrumble.com/ – provides you with tools and motivation to get you out of the red…and back in the black.
http://qflip.r08.railsrumble.com/ – Qflip is an app that integrates with the netflix api that helps people to rent randomly.
http://couldya.r08.railsrumble.com/ – Its a way to get help with things using your social network.
http://ir.r08.railsrumble.com/ -Latte Art with ratings
http://ideasftw.com – An idea incubator.
http://sheepfit.r08.railsrumble.com/ – a stretch reminder
http://www.rubyreddo.com – RubyReddo is a service to translate your GetText .po files
http://justafinlist.r08.railsrumble.com/ – Just A F***ing List
http://dense.r08.railsrumble.com/ – Dense is a simple slideshop app
http://remindr.info – Effortless one-click reminder about pretty much anything
http://ostraka.r08.railsrumble.com/ – Ostraka is the digital counterpart of ancient democratic instrument of ostracism.
http://tagueame.r08.railsrumble.com/ – Tagueame is a little experiment about socializing online opinions about your friends and family.
http://a8.r08.railsrumble.com/ – A business related app for project management, time reporting, invoicing with built in chat rooms.
http://wheresthemilkat.r08.railsrumble.com/ – find out who’s got the best prices, and where they are
http://ndebted.com – A service for tracking and sharing debts with friends
http://assassin.r08.railsrumble.com – The assassin game
Another great list of Rails Rumble 2008 apps – > http://48hrlaunch.wordpress.com/2008/10/20/rails-rumble-2008-apps/
http://revealthebias.r08.railsrumble.com/ – Reveal the Bias