Rails 4 WYSIWYG Bootsy图像上传选项未显示

时间:2014-12-21 20:23:44

标签: ruby-on-rails ruby image wysiwyg

您好我正在使用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

任何意见和建议将不胜感激。感谢

1 个答案:

答案 0 :(得分:0)

不确定您是否找到了答案,这是我发现的类似问题及其解决方案。

After upload images, how to insert the image?