From 3c4f22234bba2f060cc53d9815d0edcf44072c99 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 5 Nov 2013 19:19:36 +0800 Subject: [PATCH] fixed template updation from site preferences --- app/controllers/admin/designs_controller.rb | 3 +-- app/views/admin/designs/edit.html.erb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index f85248a8..4c670a3b 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -54,10 +54,9 @@ class Admin::DesignsController < OrbitBackendController when 'javascripts', 'themes'#, 'images' @object = @design.send(params[:type]).find(params[:object_id]) end - Dir.mktmpdir('f_path') { |dir| temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+') - temp_file.write(params[:file][:content].force_encoding('UTF-8')) + temp_file.write(params[:html_code].force_encoding('UTF-8')) @object.remove_file! @object.file = temp_file @object.save diff --git a/app/views/admin/designs/edit.html.erb b/app/views/admin/designs/edit.html.erb index efd3880a..852ad4d1 100644 --- a/app/views/admin/designs/edit.html.erb +++ b/app/views/admin/designs/edit.html.erb @@ -126,7 +126,7 @@ <% @design.javascripts.each do |js| %> -
+
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
<% end %>