11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/redactor_rails/pictures_controller.rb', line 11
def create
@picture = RedactorRails.picture_model.new
file = params[:file]
@picture.data = RedactorRails::Http.normalize_param(file, request)
if @picture.respond_to?(RedactorRails.devise_user)
@picture.send("#{RedactorRails.devise_user}=", redactor_current_user)
@picture.assetable = redactor_current_user
end
if @picture.save
render :text => { :filelink => @picture.url }.to_json
else
render :nothing => true
end
end
|