First Release of SMERF

I am happy to announce the very first release of SMERF (Simple MEta Rails Form). SMERF is a Ruby on Rails plugin that allows you to very easily create dynamic forms using a form definition file. You can quickly and easily create surveys, questionnaires, data collection or any other type of form.

It saves the user responses to a DB table which the user can then retrieve and modify at any time. Responses to each question on a form is also recorded in the DB allowing you to perform analysis of the responses via SQL queries. Check out the About and Usage pages for more information. If you have any problems, questions or suggestions please feel free to contact me at smerf at cascadia dot com dot au.


6 Responses to “First Release of SMERF”

  1. 1 Michael Schuerig

    Etienne, I haven’t tried SMERF, but I was curious how it works and so I looked at the code, though not in depth.

    I was surprised that you’re using a very heavy generator, i.e. one that copies lots and lots of files into the application. These files aren’t updated, when a new version of SMERF is installed and they clutter the application with stuff that someone only using SMERF should not be concerned about.

    If at all possible, I think it would be preferable to make SMERF into a proper template handler for Rails.

    See ActionView::TemplateHandler and ActionView::Base#register_template_handler

  2. 2 etienne

    Hi Michael,

    Thanks for your message. If you look closely at the generator there are only two files copied to the actual user’s application directories, i.e. a migration file and the smerf_helpers to the lib directory. All the other files are copied to the plugin’s own directories, the plugin has it’s own app, app/controllers, app/helpers, app/views directories. I decided to structure my plugin in this way as it’s neater and prevents all files being lumped into the plugin lib directory.

    Originally the plugin was going to assume the model used for storing user information was going to be named User, I thought this too restrictive so to allow the plugin to work with any model name I generate the plugins code with the supplied name. So in reality the generator actually generates the plugin code.

  3. 3 Alan Masterson

    Hi Etienne,

    I’ve just started using the SMERF plugin and it works well. I’m currently building an interface for our admin system.

    I notice that there is no option for a select field type. Is there a reason for this?



  4. 4 etienne

    Hi Alan,

    I’ve only added the field types that I needed to complete my project, I was hoping that people would suggest field types they would like and I could then add it for them.

    I will add the select type and upload an update for you.

  5. 5 alex

    hi etienne,

    i just started using smerf. until now everything works well, great stuff. but one suggestion: hacking the questions into yaml files is a lot of work. maybe you can at least introduce some conventions (sort order, code, field_type) so people don’t have to re-enter this for every question over and over again.i was pretty close to start writing a script that would generate the yaml file from a hash table or something DSLish:

    form do |f|
    f.question(’question1′, :type => ‘multiplechoice’).answers(’answer1′).answer(’answer2′)
    f.question(’question2′, :type => ‘textbox’)

    thsi could then auto generate all the codes and stuff or the user could set them via an optional parameter. just a rough idea.

  6. 6 etienne

    Hi Alex,

    I agree with you about maintaining the YAML file becoming a pain, and your suggestion is a good one. I should look at DRYing it up so people do not have to keep repeating the same code.

    I had envisaged that I would create an interface to allow people to visually design the forms which would hide the YAML file from the user. I’m pretty busy at the moment and I can’t see this happening in the near future so maybe an interim step DRYing up the YAML file is a good idea.

Leave a Reply