Topic: Hot plugin of the week

Instead of just listing my favorite plugins, I would like to post about one particular plugin that I found very elegant and powerful in my Rails applications. Today's flavor of the week is scope_out written by X Andrews.

I first got hip to the power of Rails' builtin with_scope function, thanks to a brilliant screencast by ryanb, our resident genius and noob savior. However I started to quickly make a mess of things as I got carried away and pushed the limits of my scopes.. but no more.

Thanks to this ingenious little plugin, creating and nesting scope conditions for my finds are so simple, it's stupid. You can read more about this plugin at the above links, and you can also check out this blog post

Enjoy! And feel free to contribute any plugins or snippets that have made you a happy coder smile

Re: Hot plugin of the week

This week's hot plugin is acts_as_textiled

If you are a Textile lover like me, you will appreciate this plugin's ease of use and speed. I tried several solutions before settling on this one. It gets the pimpmaster seal of approval!

Last edited by pimpmaster (2007-04-18 21:19:34)

Re: Hot plugin of the week

For those of you who would like to spruce of ActiveRecord's find methods and make them more Rubyish, look no further than the squirrel plugin

Now you can perform complex queries without mucking around with SQL. Perhaps that's not a big deal to some of you, but personally I can't stand SQL syntax, after getting accustomed to Ruby goodness.

Last edited by pimpmaster (2007-05-02 18:30:16)

Re: Hot plugin of the week

This week's hot flavor is a combination of a pagination plugin and an excellent write-up.

We've all heard about how pagination in Rails is messy and does not scale well. In case you haven't heard, it has been the source of much controversy and people have started holy wars over it. The carnage can be witnessed here

Us pimpmasters are more lovers than fighters so instead of whining I did some hunting and found a solution that not only worked perfectly for me, I got it working in under 10 minutes.

The plugin is called paginating_find and it is a perfect solution for those of you who, like me, tend to deal with model instances in the thousands.

You can read all about how to use this excellent plugin here:

Faster Pagination in Rails

Re: Hot plugin of the week

It's been a while since I posted in this thread.. perhaps I should change the title...ah well

On to the goods.

I'm sure you guys are used to this reptitive pattern of coding form inputs:

<p>
  <label for="first_name"><br />
  <%= form.text_field :first_name %>
</p>
<p>
  <label for="last_name"><br />
  <%= form.text_field :last_name %>
</p>
<p>
  <label for="message"><br />
  <%= form.text_area :message %>
</p>

Blech!!

Where's the DRY? Where's the LOVE?!

Enter CSSFormBuilder

Not only is this plugin well-documented and thoroughly tested (works flawlessly even in edge rails)

But is takes the above mess and converts it into this

<%= form.text_field :first_name %>
<%= form.text_field :last_name %>
<%= form.text_area :message %>

You get your html labels and functionality with all of Rails form input helpers for free.

Definitely worth checking out!

Re: Hot plugin of the week

This week's hotness is Rapt

Its not actually a plugin, but its a drop-in replacement for the default plugin/script with some nifty features. You can actually search for plugins from the command line!

I'm in love!

Re: Hot plugin of the week

Aside from having a cool name, Demeter's Revenge is an excellent tool that makes BDD much easier, especially when dealing with model associations in your controllers.

You get tons of associated methods for free which will make your specs much easier and quicker to write.

Catch the full scoop on this useful plugin here:

http://www.lukeredpath.co.uk/2007/10/18 … rs-revenge

Re: Hot plugin of the week

By far one of my favorite plugins as of late is James Golick's attribute_fu.

I'm sure many of you remember ryanb's screencasts on multi-model forms. This plugin makes the whole process as DRY as possible. Just add a few lines to your models and plug some handy view helpers and you've got dynamic model creation with zero fuss!

There is even a screencast to get you started smile

As an added bonus, thanks to a certain person's nagging, you can now even generate child and grand child models in the same form! (and you thought reproduction was complicated tongue)

James is also the author of the most-excellent resource_controllerplugin.

For those of you who are not familiar, it is my new favorite way to DRY the crap out of my controllers. I could rave about this one all day, but I will let you watch the screencast instead.

Happy Plugging!