768x90 Getting Online Shouldn't be Tough- $7.49 .com Domains at Go Daddy

Simple & Awesome Rails Form

How to create Simple, fast and awesome rails form in your rhtml or html.erb ? the answer for now is Super_In_Place_Controls & I tested in Rails 2.0. Let start to use it :

  • Install the plugin to your ruby app
ruby script/plugin install http://os.flvorful.com/svn/plugins/super_in_place_controls

  • In your layout or rhtml / html.erb put it :
<%= stylesheet_link_tag 'in_place_styles' %>

  • Done !!, let start to implement it in your view file (click the image below to enlarge).
  • For regular text_field you can change it to be :
in_place_text_field :product, :title

  • For regular text_area, you can change it to be :
in_place_text_area :product, :description

  • For regular select_tag, you can change it to be:
in_place_select :product, :product_type, :choices => %w(Awesomeness Coolness Phatness RubyBliss).map { |e| [e, e] }

  • For regular radio_collection, you can change it to be :
in_place_radio :product, :price, :choices => %w(199 299 399 499 599 699 799 899 999).map { |e| [e, e] }

  • For check box collection you can change it to be:
in_place_check_box :product, :category_ids, :choices => Category.find(:all).map { |e| [e.id, e.title] }, :display_text => :collection

  • And for date you can change to be :
in_place_date_select :product, :display_begin

  • for more style you can addcalendar_date_select_includes "blue" to the pages you want to use the calendar select on. The other styles for the calendar_date_select are "blue", "plain", "red", "silver", "default".

2 Response to "Simple & Awesome Rails Form"

Unknown said...

this is exactly what i was looking for, great job!!! can you please verify the link for the install?

Bob Walsh said...

Anyone have a sample rails 2.1 project using SuperINPlaceControls? I'm going nuts trying to get this to work....

 
powered by Blogger