【发布时间】:2016-03-02 17:48:06
【问题描述】:
我的目标是这样的输出(对于每个附件):
网址: "/uploads/attachment/picture/15/5ee306c9-e263-466b-b56d-1c7c9d2ae17b.jpg"
我现在拥有的:
attachments_controller.rb
class AttachmentsController < ApplicationController
before_action :logged_in_user
def index
@attachments = current_user.attachments.all
respond_to do |format|
format.json do
render :json => @attachments.each{ |o| o.picture.url }
end
end
end
...
【问题讨论】:
-
此时输出什么?
-
这是给 froala 所见即所得编辑器的:froala.com/wysiwyg-editor/docs/concepts/image-manager
标签: ruby-on-rails json ruby-on-rails-4