· 1 min read

Screencast: Formtastic Teil 1

Download(19.7 MB, 10:41) Alternativer Download für iPod & Apple TV (12.7 MB, 10:41)

Resourcen:

[bash] rails vet sudo rake gems:install script/generate nifty_layout script/generate nifty_scaffold category name:string description:text rake db:migrate script/generate formtastic_stylesheets script/generate nifty_scaffold animal name:string category_id:integer born_on:date female:boolean [/bash] [html] <%= stylesheet_link_tag ‘application’, ‘formtastic’, ‘formtastic_changes’, :cache => “base” %>

<% semantic\_form\_for @category do |f| %> <%= f.inputs %> <%= f.buttons %> <% end %> <% semantic\_form\_for @animal do |f| %> <% f.inputs do %> <%= f.input :name %> <%= f.input :born\_on, :start\_year => 1900 %> <%= f.input :category, :include\_blank => false %> <%= f.input :female, :as => :radio, :label => "Gender", :collection => \[\["Male", false\], \["Female", true\]\] %> <% end %> <%= f.buttons %> <% end %> \[/html\]
Back to Blog