您好我正在使用Bootsy并且工作正常,不幸的是图片上传选项不起作用我已经安装了CarrierWave,它也正常工作。
我的表单
<%= f.bootsy_area(:description) %>
我的模特
class Page < ActiveRecord::Base
belongs_to :user
include Bootsy::Container
require 'carrierwave/orm/activerecord'
mount_uploader :attachment, AttachmentUploader
extend FriendlyId
friendly_id :title, use: :slugged
validates :title, :presence => true
validates :slug, :presence => true
validates :user_id, :presence => true
def should_generate_new_friendly_id?
new_record? || !self.slug.present? && self.title.present?
end
end
我的控制器
def pages_params
params.require(:page).permit(:title, :description, :status, :slug, :user_id, :password, :attachment, :bootsy_image_gallery_id)
end
def create
@page = Page.new(pages_params)
if @page.save
redirect_to(:action => "index")
else
render("new")
end
end
任何意见和建议将不胜感激。感谢