FAQ_U Rails FAQ Generator Plugin
December 20th, 2007 by pyrat
For a christmas present I give you the Rails FAQ Generator plugin FAQ_U.
This is a simple layout-less unbranded Frequently Asked Questions system. The idea is you generate the default system and then customise it to the requirements of the particular project that you are working on.
Remember to add some authentication to the faq_admin controller.
Requires HAML. To install it:
gem install --no-ri haml
haml --rails path/to/appTo install the plugin:
./script/plugin install http://vorlich.ath.cx/code/excited/plugins/faq_uTo run the generator:
./script/generate faq
This generates a FAQ admin controller, FAQ view controller, the necessary views, a model, db migration and a collection of
tests.
After the generator is complete run the migration to get the database up to scratch.
rake db:migrate
The faq admin is available at */faq_admin* and the front end at */faq*. As you can see below it looks pretty filthy, but as you can see below that, with the introduction of a layout it looks nicer.

A would be nice would be a nice AJAX ordering interface in the faq_admin. Feel free to send me some svn patches of any improvements you make. Please write some tests to prove the new functionality works. Cheers now, Merry Christmas.


December 20th, 2007 at 2:02 pm
Haven’t tried it out yet (Not a fan on Haml) but great idea.
Are there any other plugins of a similar nature?
December 20th, 2007 at 4:17 pm
You should be able to convert the templates to rhtml without much hassle if you are not a fan of haml. I dont know of any other faq plugins out there. That is partly why I wrote it!
Cheers now.
January 30th, 2008 at 11:51 am
I think there’s a bug in the generated migration:
t.column :question, :text
t.column :answer, :string
It should be:
t.column :question, :string
t.column :answer, :text
Usually, questions are short, and answers are longer
BTW: I’m a big fan of haml. I’m using it in my new projects, and I can’t imagine me returning to rhtml now
January 30th, 2008 at 3:01 pm
Thanks for the bug report! Ive made this change.
Cheers, Alastair
February 22nd, 2008 at 5:08 pm
Nice plugin.
I had a requirement to add FAQs to an application, but didn’t want to store them in the database. So, I’ve written a plugin that stores FAQs as YAML files.
http://rubyforge.org/forum/forum.php?forum_id=22009
Would’ve used HAML, but I haven’t gotten around to converting all my old apps yet!
David