Quick ruby-powered html-forms?

C

Casimir

I am certain someone has made a solution for quickly creating forms with
ruby. Any ideas? (other than installing rails)

Thanks

Casimir
 
J

Jean-François Trân

2008/1/22, Casimir :
I am certain someone has made a solution for quickly
creating forms with ruby. Any ideas? (other than installing rails)

You've got plenty templating systems (ERB, Markaby, Haml...),
to name a few. There's also the HtmlExtension module in cgi lib.

-- Jean-Fran=E7ois.
 
S

Starr Trader

Casimir said:
I am certain someone has made a solution for quickly creating forms with
ruby. Any ideas? (other than installing rails)

Thanks

Casimir

Believe it our not, this is still something that seems to be missing
even in rails. Forms can be built from eRB or other template libraries,
but that still requires some fairly close interaction with the nuts and
bolts of the form especially if you want more then just the default
types.

This is an area where the separation of content from presentation is
still a real challenge. It should be possible to describe what data one
wants from the use in one place and make decisions about how to ask for
that data in another. If you have any luck with this let us know.

StarTrader

P.S. This inspired a slightly more length blog post:
http://startrader.wordpress.com/2008/01/22/towards-a-better-way-to-build-forms/
 
C

Casimir

Starr Trader kirjoitti:
Thanks for answers, even if no-one so far has presented "the winning
solution".

How to take the pain away from form writing? How to bring back the
POWER? How to avoid dealing with minute form details while trying to
build proper apps/services?

Jean-François Trân kirjoitti:
You've got plenty templating systems (ERB, Markaby, Haml...),
to name a few. There's also the HtmlExtension module in cgi lib.

Thank you. To nitpick, you didn't really answer my question, but the
question "what kind of templating systems are there". I didnt ask for a
templating system :) Some would be suitable for what I was asking for.
Haml and Hpricot are now under my investigative gaze...
Believe it our not, this is still something that seems to be missing
even in rails. Forms can be built from eRB or other template libraries,
but that still requires some fairly close interaction with the nuts and
bolts of the form especially if you want more then just the default
types.
This is an area where the separation of content from presentation is
still a real challenge.

To nitpick, I dont think this is the problem, you have misinterpreted my
question or the concept of content.

Personally, I am just trying to find the simplest, most intuitive (->
fastest) way to create html code for forms. Styling (presentation)
happens entirely in css so it has nothing to do with form content. So I
think you have a slight misinterpretation there.
It should be possible to describe what data one
wants from the use in one place and make decisions about how to ask for
that data in another. If you have any luck with this let us know.

Now this idea I like. Wham! Blam! Thank you mam!

More than words... is what I would like to see... URLs.

Thanks
Csmr
 
A

Andrew Stewart

How to take the pain away from form writing? How to bring back the
POWER? How to avoid dealing with minute form details while trying
to build proper apps/services?
Personally, I am just trying to find the simplest, most intuitive (-
(presentation) happens entirely in css so it has nothing to do with
form content. So I think you have a slight misinterpretation there.
More than words... is what I would like to see... URLs.

If you're using Rails you should look into form builders. When you
create a form like this:

<% form_for @project do |f| %>
<%= f.text_field :name %>
...
<%= f.submit %>
<% end %>

...you are using an instance of Rails' form builder (in the f
variable): ActionView::Helpers::FormBuilder.

I recommend writing your own form builder to generate exactly the
HTML you want.

Here are a couple of custom form builders packaged as plugins:

http://svn.danwebb.net/external/rails/plugins/enhanced_form_builder/
http://opensource.airbladesoftware.com/trunk/plugins/
air_budd_form_builder/

Regards,
Andy Stewart
 
K

khaines

Personally, I am just trying to find the simplest, most intuitive (->
fastest) way to create html code for forms. Styling (presentation) happens
entirely in css so it has nothing to do with form content. So I think you
have a slight misinterpretation there.

Styling isn't 100% an issue of CSS because of two factors.

1) Any specifics regarding ids or classes to be applied to particular form
elements have to appear in the HTML.

2) Any pecularities regarding the form structure, which ultimately affect
it's appearance in fundamental ways that CSS can't influence, is also part
of the HTML.

So, given those two things, here's how I tend to deal with form generation
in IOWA (iowa.swiftcore.org):

<form oid="do_something">
<label>Choose a number</label>
<listbox oid="number" list="{1..10}" />
<submit value="That's my number!" oid="do_something" />
</form>

This keeps all of the low level details about managing the form out of the
developer's hair. The developer just lays out the structure, and expects
that when the submit button is pressed, do_something() is called, and the
number that was selected will be passed to the number=() accessor.


Kirk Haines
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,277
Messages
2,571,385
Members
48,088
Latest member
AngieMaliz

Latest Threads

Top