Skip to content

Instantly share code, notes, and snippets.

@gbelote
Forked from gabewb/gist:583535
Created September 17, 2010 02:09
Show Gist options
  • Save gbelote/583537 to your computer and use it in GitHub Desktop.
Save gbelote/583537 to your computer and use it in GitHub Desktop.
<% form_for @board do |f| %> # form_for ( symbol or actual object ) do |(var)|
<% f.label :title %>:
<% f.text_field :title %><br />
<% f.label :price %>
<% f.text_field :price %><br />
<% f.submit %>
<% end %>
@gbelote
Copy link
Author

gbelote commented Sep 17, 2010

The form helper created by form_for will pull properties :title and :price from the object passed in (@board). Note that you could also use :board if you don't have an object, but in this case form_for will pre-populate the fields :title and :price with @board.title and @board.price, respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment