You aren’t going to be extending a controller and a model with just one line in a controller, since controllers aren’t that directly connected to models. For some tips on how to write plugins, though, see the wiki: http://wiki.rubyonrails.com/rails/pages/HowTosPlugins
Another way to learn is to look at the excellent plugins written by Rick Olson: http://svn.techno-weenie.net/projects/plugins/