https://github.com/codeyellowbv/rails-formbuilder
Form builder plugin for Ruby On Rails
https://github.com/codeyellowbv/rails-formbuilder
Last synced: about 2 months ago
JSON representation
Form builder plugin for Ruby On Rails
- Host: GitHub
- URL: https://github.com/codeyellowbv/rails-formbuilder
- Owner: CodeYellowBV
- Created: 2014-08-20T14:36:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-24T08:14:05.000Z (over 11 years ago)
- Last Synced: 2025-03-06T01:45:40.986Z (over 1 year ago)
- Language: Ruby
- Size: 289 KB
- Stars: 2
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Form builder plugin
===================
The form builder plugin allows you to create forms in your application in
a WYSIWYG fashion. By dragging items onto a canvas, forms are built by
the user.
Creating custom form item types is easy: Just create a model for it that
inherits from one of the existing form item types (or just the base
class: FormItem) and a cell which has the name of the model, with a
suffix of 'Cell'. The cell class must inherit from the cell that
belongs to the superclass of the model. So, for example, if you have
a SmartIntegerControl model that inherits from IntegerControl, you need
a SmartIntegerControlCell class that inherits from IntegerControlCell.
After creating your custom form item types you must register them with
the FormBuilder module so it knows about them, for example:
FormBuilder.register_classes(:smart_integer_control, :my_other_control).
You can modify or enhance existing models and cells like you would with
any Engine; just place a class in your app with the same name as the one
you would like to modify, then put any new or overriden methods in it.
If you only want to override a view for a cell state, you just put a
view with the same name in your app directory and it will be used
instead of the one in the plugin.
Requirements
============
Version 1.1 was tested against Rails 3.1 with Ruby 1.9.
Gems
----
To make formbuilder work properly, you will need the following gems
installed. The version numbers in brackets are the ones we've tested
against.
- bluecloth [2.2.0]
- acts_as_list [0.4.0]
- cells (https://github.com/apotonick/cells) [3.5.0]
- will_paginate [3.0.7]
You might be able to do without BlueCloth if you disable the use of
InformationalStatic form elements. If you write your own views,
you won't need will_paginate either.
Libraries
---------
You will also need gettext, or put this in lib/gettext_stub.rb:
module GetText
def N_(str)
str
end
def _(str)
str
end
end
This must then be loaded in your config/environment.rb, by putting this
*before* your `App.initialize!`
require "#{Rails.root}/lib/gettext_stub.rb"
include GetText
Helpers
-------
In your application.rb, put the following require statement to load
the helpers provided by this engine:
require_dependency("#{Rails.root}/vendor/plugins/formbuilder/app/helpers/application_helper.rb")
LICENSE
=======
Copyright (c)2008-2009 Solide ICT (http://www.solide-ict.nl)
Copyright (c)2014 Code Yellow BV (http://www.codeyellow.nl)
Initial development sponsored by the MAPS Foundation (http://www.mapsfoundation.org)
This work falls under a Creative Commons 'by-nc-sa' license, except
where declared otherwise. This license has the following attributes:
You are free:
* To share -- To copy, distribute and transmit the work
* To remix -- To adapt the work
Under the following conditions:
* Attribution -- You must attribute the work in the manner specified by
the author or licensor (but not in any way that suggests that they endorse
you or your use of the work)
* Noncommercial -- You may not use this work for commercial purposes
* Share Alike -- If you alter, transform, or build upon this work, you
may distribute the resulting work only under the same or similar license to this one.
For more information, see:
http://creativecommons.org/licenses/by-nc-sa/3.0/