Help on preferences

<% form_tag :action => 'update' do %> <% def table_row(pref_name, nowrap_label = false, &block) nowrap_attribute = nowrap_label ? ' nowrap="nowrap"' : '' s = %Q|\n\n" s end def row_with_select_field(pref_name, collection = [true,false], nowrap_label = false) table_row(pref_name, nowrap_label) { select('prefs', pref_name, collection) } end def row_with_text_field(pref_name, nowrap_label = false) table_row(pref_name, nowrap_label) { text_field('prefs', pref_name) } end %> <%= row_with_text_field('date_format') %> <%= row_with_text_field('title_date_format') %> <%= table_row('time_zone', false) { time_zone_select('prefs','time_zone') } %> <%= row_with_select_field("week_starts", Preference.day_number_to_name_map.invert.sort{|a,b| a[1]<=>b[1]})%> <%= row_with_select_field("due_style", [['Due in ___ days',Preference.due_styles[:due_in_n_days]],['Due on _______',Preference.due_styles[:due_on]]]) %> <%= row_with_select_field("show_completed_projects_in_sidebar") %> <%= row_with_select_field("show_hidden_projects_in_sidebar") %> <%= row_with_select_field("show_hidden_contexts_in_sidebar") %> <%= row_with_select_field("show_project_on_todo_done") %> <% if current_user.is_admin? %> <%= row_with_text_field('admin_email') %> <% end %> <%= row_with_text_field('staleness_starts', true) %> <%= row_with_text_field('show_number_completed') %> <%= row_with_text_field('refresh') %> <%= row_with_select_field("verbose_action_descriptors") %> <%= row_with_text_field("mobile_todos_per_page") %> <%= row_with_text_field("sms_email") %> <%= table_row("sms_context", false) { select('prefs', 'sms_context_id', current_user.contexts.map{|c| [c.name, c.id]}) } %>
<%= text_field 'user', 'first_name' %>
<%= text_field 'user', 'last_name' %>
\n| s << yield s << "\n
<%= submit_tag "Update" %> <%= link_to "Cancel", :action => 'index' %>
<% end %>