Hacked the admin images controller to work
This commit is contained in:
parent
cad4471995
commit
713d30bdb6
@ -17,13 +17,16 @@ module Admin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
params[:asset] = { :name => params[:name], :source => params[:file] } if params[:file]
|
params[:asset] = { :name => params[:name], :source => params[:file], :collection => begin_of_association_chain } if params[:file]
|
||||||
|
|
||||||
create! do |success, failure|
|
a = Asset.new(params[:asset])
|
||||||
success.json do
|
|
||||||
render :json => image_to_json(@asset)
|
begin
|
||||||
end
|
a.save!
|
||||||
failure.json { render :json => { :status => 'error' } }
|
render :json => image_to_json(a)
|
||||||
|
rescue Exception => e
|
||||||
|
# Rails.logger.info e.backtrace.join("\n")
|
||||||
|
render :json => { :status => 'error' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user