CSS Form Builder plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/cssformbuilder/trunk
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 %>
File app/views/customers/_form.rhtml:
<%= error_messages_for 'customer' %> <pre> <% fieldset_tag 'General data' do %> <%= @f.text_field :code, :class=>'half-size' %> <%= @f.text_field :name, :class=>'double-size' %> <%= @f.select(:bank_id, Bank.to_select, {:include_blank => true}, {:class=>'normal-size'} ) %> <%= @f.check_box :option1 %> <%= @f.hidden_field :field1 %> <% end %>
After installation: - copy vendor/plugins/cssformbuilder/stylesheet/css_form.css into your public/stylesheets/ folder. - include css_form.css in your template (<%= stylesheet_link_tag 'css_form' %>)
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (1 older version) | Last edited by: scott, 7 months ago

