fixed template updation from site preferences
This commit is contained in:
parent
bae1c0da7d
commit
3c4f22234b
|
@ -54,10 +54,9 @@ class Admin::DesignsController < OrbitBackendController
|
||||||
when 'javascripts', 'themes'#, 'images'
|
when 'javascripts', 'themes'#, 'images'
|
||||||
@object = @design.send(params[:type]).find(params[:object_id])
|
@object = @design.send(params[:type]).find(params[:object_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir.mktmpdir('f_path') { |dir|
|
Dir.mktmpdir('f_path') { |dir|
|
||||||
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
|
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.remove_file!
|
||||||
@object.file = temp_file
|
@object.file = temp_file
|
||||||
@object.save
|
@object.save
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% @design.javascripts.each do |js| %>
|
<% @design.javascripts.each do |js| %>
|
||||||
<div class="clearfix tab-pane fade active in" id="#<%= dom_id js %>">
|
<div class="clearfix tab-pane fade active in" id="<%= dom_id js %>">
|
||||||
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
|
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue