【问题标题】:CKEditor not displaying with Zurb FoundationCKEditor 不与 Zurb Foundation 一起显示
【发布时间】:2013-08-29 09:50:22
【问题描述】:

我在 Rails 应用程序中使用 CKEditor (gem 'ckeditor') 和 Foundation,但它们不能很好地配合使用。几天来我一直在寻找答案,但都尝试了这两种解决方案,但都没有运气:

ckeditor wont show up in zurb foundation

https://github.com/zurb/foundation/issues/2778

我通过创建一个全新的测试应用程序,添加 CKEditor(工作正常),然后添加 Foundation(Gemfile + 捆绑安装),然后 CKEditor 不再显示,从而确定这是 Foundation 的问题。这是我的测试应用程序中的一些示例代码:

<style>
  textarea{-moz-box-sizing: content-box;-webkit-box-sizing: content-box;box-sizing: content-box;}
</style>

<%= form_for @thing do |form| -%>
  <div class="field">
  <%= form.cktext_area :name, cols: 50, rows: 20, :class => "someclass", :ckeditor => {:uiColor => "#AADC6E", :toolbar => "mini"} %>
  </div>
<%- end %>

我在内部添加了样式,以防需要在 Foundation 样式之后添加样式(我也尝试将其内联添加到文本区域,但无济于事)。

任何帮助将不胜感激。

【问题讨论】:

    标签: ruby-on-rails ckeditor zurb-foundation


    【解决方案1】:

    Foundation gem 会覆盖应用程序布局文件 (app/views/layout.html.erb)。 如果您使用 gem,请确保您仍然拥有指向资产管道中的应用程序文件的链接 (&lt;%= javascript_include_tag "application" %&gt;)。此行应位于&lt;head&gt; 标记之间。 希望这行得通。

    【讨论】:

    • 谢谢!我的布局文件中仍然有 javascript 包含标记,但它不再位于头部 - 这是关键。
    • 顺便说一句,通过此修复,无需额外的样式或添加列和行尺寸。
    猜你喜欢
    • 1970-01-01
    • 2013-08-08
    • 2012-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-14
    • 1970-01-01
    相关资源
    最近更新 更多