Fix previous workaround for the uploaded Design
This commit is contained in:
parent
a571d1dcff
commit
77b8fcdd1d
|
@ -86,10 +86,14 @@ class Design
|
||||||
|
|
||||||
def process_object(object)
|
def process_object(object)
|
||||||
if object.to_save
|
if object.to_save
|
||||||
|
if object.file_filename.nil?
|
||||||
new_object = self.send(object._type.downcase.pluralize).build
|
new_object = self.send(object._type.downcase.pluralize).build
|
||||||
new_object.file = object.file
|
new_object.file = object.file
|
||||||
object.destroy
|
object.destroy
|
||||||
new_object.save
|
new_object.save
|
||||||
|
else
|
||||||
|
object.save
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if object.to_destroy
|
if object.to_destroy
|
||||||
object.destroy
|
object.destroy
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<a class="remove_mark" href="#"><%= t('Delete') %></a>
|
<a class="remove_mark" href="#"><%= t('Delete') %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if classes.include?('r_editable') %>
|
<% if classes.include?('r_edit') %>
|
||||||
<a class="edit_mark" href="#"><%= t('Edit') %></a>
|
<a class="edit_mark" href="#"><%= t('Edit') %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -36,11 +36,11 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "themes", :f => f, :classes => "r_destroy, r_editable" } %>
|
<%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "themes", :f => f, :classes => "r_destroy, r_edit" } %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "javascripts", :f => f, :classes => "r_destroy, r_editable" } %>
|
<%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "javascripts", :f => f, :classes => "r_destroy, r_edit" } %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue