Project

formhelper

0.0
No commit activity in last 3 years
No release in over 3 years
This is a library to create different form field elements, allows form object to parse into different formats (YAML, JSON, XML)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.4.3

Runtime

~> 1.4.3
 Project Readme

formhelper¶ ↑

This is a library to create different form field elements, allows form object to parse into different formats (YAML, JSON, XML)

INSTALLATION¶ ↑

sudo gem install formhelper

BASIC USAGE¶ ↑

require ‘rubygems’

require ‘formhelper’

# Create a form object

form = FormHelper::Form.new()

# Create short answer and long answer objects

sa = FormHelper::ShortAnswer.new(:id => “email_1”,:label => “Personal email address” )

la = FormHelper::LongAnswer.new(:id => “comment_1”,:label => “Provide your comments below”)

# Add short answer and long answer objects

form.add(sa)

form.add(la)

# Returns YAML format of form

form.to_yml

# Returns XML format of form

form.to_yml