diff app/views/my/account.html.erb @ 1235:775d89567f41 redmine-2.2-integration

Converting fields_for ... :builder => TabularFormBuilder to labelled_fields_for seems like the thing to do
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 14 Mar 2013 12:16:26 +0000
parents bb32da3bea34
children 51364c0cd58f
line wrap: on
line diff
--- a/app/views/my/account.html.erb	Wed Mar 13 14:00:01 2013 +0000
+++ b/app/views/my/account.html.erb	Thu Mar 14 12:16:26 2013 +0000
@@ -30,30 +30,28 @@
   <%= call_hook(:view_my_account, :user => @user, :form => f) %>
 </fieldset>
 
+<%= labelled_fields_for :ssamr_user_details, @user.ssamr_user_detail do |fields| %>
 <h3><%=l(:label_ssamr_details)%></h3>
 <div class="box tabular">
-    <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>
        <p>
-         <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 25, :required => true, :class => 'wiki-edit' %>
+         <%= fields.text_area :description, :rows => 3, :cols => 25, :required => true, :class => 'wiki-edit' %>
        </p>
 
-
             <p><label for="institution"><%=l("field_ssamr_user_detail.institution")%> <span class="required">*</span></label>
 			<nobr>
-              <%= ssamr_user_detail.radio_button :institution_type, true %>
-              <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&amp;', '&') %>
+              <%= fields.radio_button :institution_type, true %>
+              <%= fields.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&amp;', '&').html_safe %>
             </nobr>
 			</p>
 
             <p>
 				<nobr>
-               		<%= ssamr_user_detail.radio_button :institution_type, false %> Other:
-               		<%= ssamr_user_detail.text_field :other_institution, :size => 19 %>
+               		<%= fields.radio_button :institution_type, false %> Other:
+               		<%= fields.text_field :other_institution, :size => 19 %>
             	</nobr>
             </p>
-    <% end %>
 </div>
-
+<% end %>
 
 <%= submit_tag l(:button_save) %>
 </div>
@@ -72,14 +70,6 @@
 </div>
 <% end %>
 
-
-
-
-
-
-
-
-
 <% content_for :sidebar do %>
 <%= render :partial => 'sidebar' %>
 <% end %>