FAQ_U Rails FAQ Generator Plugin

December 20th, 2007 by pyrat

Faq u

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/app

To install the plugin:

./script/plugin install http://vorlich.ath.cx/code/excited/plugins/faq_u

To 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.

unstyled

styled

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.

5 Responses to “FAQ_U Rails FAQ Generator Plugin”

  1. Femi Says:

    Haven’t tried it out yet (Not a fan on Haml) but great idea.
    Are there any other plugins of a similar nature?

  2. pyrat Says:

    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.

  3. Knack Says:

    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

  4. pyrat Says:

    Thanks for the bug report! Ive made this change.

    Cheers, Alastair

  5. David Salgado Says:

    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

Leave a Reply