add nokogiri into Gemfile and fixing dup bug again...
This commit is contained in:
1 parent
c9e4d0f345
commit
b6db304579
6 files changed
+17
-3
No files matched your search
@@ -15,7 +15,7 @@ function r_editor(tgetUrl,tpostUrl,tfilename,toption){
|
||||
html = $(code);
|
||||
html.children("textarea").load(editor.getUrl);
|
||||
html.children("input.discard").click(function(){
|
||||
editor.reload();
|
||||
editor.destroy();
|
||||
});
|
||||
html.children("input.send").click(function(){
|
||||
editor.send();
|
||||
|
||||
@@ -23,6 +23,13 @@ class Admin::DesignsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def apply
|
||||
@design = Design.find(params[:id])
|
||||
#TODO do somehting to validate
|
||||
debugger
|
||||
doc = Nokogiri::HTML(@design.layout.file.read)
|
||||
end
|
||||
|
||||
def edit_file
|
||||
@design = Design.find(params[:id])
|
||||
filename = params[:filename]
|
||||
|
||||
@@ -36,8 +36,10 @@ class Design
|
||||
def files=(attrs)
|
||||
files = eval(attrs.last)
|
||||
attrs[0].each do |a|
|
||||
if(a[:id]=='' && !a[:file].nil?)
|
||||
files.build(:file => a[:file], :to_save => true)
|
||||
if(a[:id]=='' && !a[:file].nil? )
|
||||
if(a[:file]!='')
|
||||
files.build(:file => a[:file], :to_save => true)
|
||||
end
|
||||
else
|
||||
files.each do |file|
|
||||
if file.id.to_s == a[:id]
|
||||
|
||||
Reference in new issue
Block a user