Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Created January 20, 2009 20:18
Show Gist options
  • Save TheNicholasNick/49644 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/49644 to your computer and use it in GitHub Desktop.
= form_for @user, :action => url(:user_settings, @user) do
%ul
%li
= text_field :first_name, :label => "First Name"
%li
= text_field :last_name, :label => "Last Name"
%p
The following is what shows up on printed quotes
%ul
- @user.user_details.all(:order => [:order.asc]).each do |ud|
%li
= fields_for ud do
= text_field :order
= text_field :key
= text_field :value
<form method="post" action="/settings/update/1"><input type="hidden" name="_method" value="put"/><ul>
<li>
<label for="user_first_name">First Name</label><input type="text" id="user_first_name" name="user[first_name]" value="John" class="text"/>
</li>
<li>
<label for="user_last_name">Last Name</label><input type="text" id="user_last_name" name="user[last_name]" value="Smith" class="text"/>
</li>
</ul>
<p>
The following is what shows up on printed quotes
</p>
<ul>
<li>
<input type="text" id="user_detail_order" name="user_detail[order]" value="1" class="text"/>
<input type="text" id="user_detail_key" name="user_detail[key]" value="Name:" class="text"/>
<input type="text" id="user_detail_value" name="user_detail[value]" value="John Smith" class="text"/>
</li>
<li>
<input type="text" id="user_detail_order" name="user_detail[order]" value="2" class="text"/>
<input type="text" id="user_detail_key" name="user_detail[key]" value="Phone:" class="text"/>
<input type="text" id="user_detail_value" name="user_detail[value]" value="02 0000 3333" class="text"/>
</li>
</ul>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment