Commit e9bffd387f1593a8c43fb96d5e9f2d3143a736c5

Authored by Braulio Bhavamitra
2 parents 538bb500 05db3adf

Merge branch 'custom_form-rails3' into 'master'

More fixes for custom forms plugin migration to rails 3

A couple of bugs in custom forms plugin on rails 3 I found while testing another feature, see commit message.

See merge request !409
plugins/custom_forms/lib/custom_forms_plugin/text_field.rb
1 class CustomFormsPlugin::TextField < CustomFormsPlugin::Field 1 class CustomFormsPlugin::TextField < CustomFormsPlugin::Field
2 set_table_name :custom_forms_plugin_fields 2 set_table_name :custom_forms_plugin_fields
3 -  
4 - attr_accessible :name  
5 end 3 end
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <h2><%= _('Fields') %></h2> 23 <h2><%= _('Fields') %></h2>
24 24
25 <ul class='field-list'> 25 <ul class='field-list'>
26 - <% f.fields_for :fields do |builder| %> 26 + <%= f.fields_for :fields do |builder| %>
27 <li> 27 <li>
28 <%= render partial_for_class(builder.object.class), :f => builder %> 28 <%= render partial_for_class(builder.object.class), :f => builder %>
29 </li> 29 </li>
plugins/custom_forms/views/custom_forms_plugin_myprofile/custom_forms_plugin/_select_field.html.erb
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 </tr> 27 </tr>
28 </tfoot> 28 </tfoot>
29 <tbody class='field-list'> 29 <tbody class='field-list'>
30 - <% f.fields_for :alternatives do |builder| %> 30 + <%= f.fields_for :alternatives do |builder| %>
31 <%= render partial_for_class(builder.object.class), :f => builder %> 31 <%= render partial_for_class(builder.object.class), :f => builder %>
32 <% end %> 32 <% end %>
33 </tbody> 33 </tbody>
plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 <% end %> 31 <% end %>
32 <% else %> 32 <% else %>
33 - <% fields_for :submission, @submission do |f| %> 33 + <%= fields_for :submission, @submission do |f| %>
34 <%= render :partial => 'shared/form_submission', :locals => {:f => f} %> 34 <%= render :partial => 'shared/form_submission', :locals => {:f => f} %>
35 <% end %> 35 <% end %>
36 <% end %> 36 <% end %>
plugins/custom_forms/views/tasks/custom_forms_plugin/_membership_survey_accept_details.html.erb
1 <% @form = CustomFormsPlugin::Form.find(task.form_id) %> 1 <% @form = CustomFormsPlugin::Form.find(task.form_id) %>
2 -<% @submission = CustomFormsPlugin::Submission.new(:form_id => @form.id, :profile_id => user.id) %> 2 +<% @submission = CustomFormsPlugin::Submission.new(:form => @form, :profile => user) %>
3 3
4 <h2><%= @form.name %></h2> 4 <h2><%= @form.name %></h2>
5 <p><%= @form.description %></p> 5 <p><%= @form.description %></p>
@@ -11,6 +11,6 @@ @@ -11,6 +11,6 @@
11 <% end %> 11 <% end %>
12 <% end %> 12 <% end %>
13 13
14 -<% f.fields_for :submission do |fi| %> 14 +<%= f.fields_for :submission do |fi| %>
15 <%= render :partial => 'shared/form_submission', :locals => {:f => fi} %> 15 <%= render :partial => 'shared/form_submission', :locals => {:f => fi} %>
16 <% end %> 16 <% end %>