progress today, clicking and fixing
This commit is contained in:
@@ -6,10 +6,11 @@ module Admin
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@svg_element = SvgElement.new
|
||||
end
|
||||
|
||||
def create
|
||||
@svg_element = SvgElement.new(svg_element_params)
|
||||
if @svg_element.save
|
||||
redirect_to [:edit, :admin, @svg_element]
|
||||
else
|
||||
@@ -18,6 +19,7 @@ module Admin
|
||||
end
|
||||
|
||||
def update
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
if @svg_element.update_attributes svg_element_params
|
||||
redirect_to [:edit, :admin, @svg_element]
|
||||
else
|
||||
@@ -26,11 +28,11 @@ module Admin
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -114,7 +114,7 @@ module Suppliers
|
||||
image_type = match[1]
|
||||
decoded_attribute = Base64.decode64 value.sub BASE64_IMAGE_MATCHER, ''
|
||||
file = Tempfile.new(['image', ".#{image_type}"])
|
||||
tempfiles << file
|
||||
@tempfiles << file
|
||||
file.binmode
|
||||
file.write decoded_attribute
|
||||
authorized_params[attribute] = file
|
||||
|
||||
Reference in New Issue
Block a user