[Home]HomePage

HomePage | RecentChanges | Preferences

CSS Form Plugin

A little ruby on rails plugin containing a form builder that uses css to produce tableless form.

Features

Sample usage

File app/views/customers/_form.rhtml:

   <%= error_messages_for 'customer' %>
   <!--[form:customer]-->
   <% fieldset_tag 'General data' do %>
       <%= @f.text_field :code, :class=>'half-size' %>
       <%= @f.text_field :name, :class=>'double-size' %>
       <br />
       <%= @f.select(:bank_id, Bank.to_select, {:include_blank => true}, {:class=>'normal-size'} ) %>
       <%= @f.check_box :option1  %>
       <%= @f.hidden_field :field1  %>
     <% end %>
   <!--[eoform:customer]-->

File app/views/customers/new.rhtml:

   <% css_form_for :customer, @customer, :url => { :action => "create" } do |@f| %>
     <%= render :partial => 'form' %>
     <%= submit_tag 'Create' %>
   <% end %>

File app/views/customers/edit.rhtml:

   <% css_form_for :customer, @customer, :url => { :action => 'update', :id => @customer } do |@f| %>
     <%= render :partial=> 'form' %>
     <%= submit_tag 'Edit' %>
   <% end %>

File app/views/customers/show.rhtml:

   <% css_show_for :customer, @customer,  do |@f| %>
     <%= render :partial=> 'form' %>
   <% end %>

Download

Download [cssFormplugin]

Installation

      script/plugin install svn://rubyforge.org/var/svn/cssformbuilder/trunk

After installation:

Licence

 MIT

For info about this plugin, write to: addsw.it [at] gmail.com

Copyright (c) 2006-2008 AD.D. Software


HomePage | RecentChanges | Preferences
Edit text of this page | View other revisions
Last edited June 5, 2008 7:22 am by elgafwout2.elsag.it (diff)
Search: