Skip to content

Commit

Permalink
Merge pull request #2 from projecthydra/remove_unnecessary_parameter
Browse files Browse the repository at this point in the history
Remove unnecessary parameter
  • Loading branch information
jcoyne committed Jun 18, 2013
2 parents 94f3ba0 + e333eda commit f599bf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/views/records/_edit_field.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<% render_req ||= true # render_req is true for single file edit, false for batch edit%>
<div class="control-group">
<% vals = record[key] %>
<% if render_req && record.required?(key) %>
<% vals = f.object[key] %>
<% if render_req && f.object.required?(key) %>
<% tmp = '<span class="error">*</span>' + field_label(key) %>
<%= f.label key, tmp.html_safe, :class=>"control-label" %>
<% else %>
<%= f.label key, field_label(key), :class=>"control-label"%>
<% end %>
<% vals.to_ary.each_with_index do |v, index| %>
<%= render_edit_field_partial(key, record: record, f:f, v: v, index: index, render_req: render_req) %>
<%= render_edit_field_partial(key, f:f, v: v, index: index, render_req: render_req) %>
<% end %>
</div><!-- /control-group -->

4 changes: 2 additions & 2 deletions app/views/records/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div id="descriptions_display">
<h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
<div class="well">
<% record.terms_for_editing.each do |term| %>
<%= render :partial => "records/edit_field", :locals => {record: record, :f =>f, :render_req => true, :key => term } %>
<% f.object.terms_for_editing.each do |term| %>
<%= render :partial => "records/edit_field", :locals => {:f =>f, :render_req => true, :key => term } %>
<% end %>
</div><!-- /well -->
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/records/edit_fields/_default.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="controls" <% if index == 0 %> id="additional_<%= key.to_s %>_clone" <% end %>>
<% required = render_req && (index == 0) && record.required?(key) %>
<%= text_field_tag "#{record.class.model_name.underscore}[#{key.to_s}][]", v, :id => "#{record.class.model_name.underscore}_#{key.to_s}", :class => "input-large", :required => required %>
<% unless record.class.unique?(key) %>
<% required = render_req && (index == 0) && f.object.required?(key) %>
<%= text_field_tag "#{f.object.class.model_name.underscore}[#{key.to_s}][]", v, :id => "#{f.object.class.model_name.underscore}_#{key.to_s}", :class => "input-large", :required => required %>
<% unless f.object.class.unique?(key) %>
<%= render :partial=>"records/edit_fields/suffix", :locals=>{key: key, index: index} %>
<% end %>
</div>
Expand Down

0 comments on commit f599bf3

Please sign in to comment.