I am not aware of the plugin, but one problem I see in your code-snippet in general is that you are not operating on a specific object @question
, but on the class Question
. If I had to take a guess, I would say that this is the source of your problem.
Edit:
So, I just checked out the documentation for the gem and I found this code-snippet directly there:
<% tag_cloud(@tags, %w(css1 css2 css3 css4)) do |tag, css_class| %>
<%= link_to tag.name, { :action => :tag, :id => tag.name }, :class => css_class %>
<% end %>
As you can see, this is pretty much what I just told you. Instead of working on the class you have to work on a specific object or, like in the shown case, a collection of objects.