【问题标题】:Insert an image with ruby in popover bootstrap在弹出窗口引导程序中插入带有 ruby​​ 的图像
【发布时间】:2016-02-28 22:02:40
【问题描述】:

这是我尝试放入 popover 的图像 ruby​​ 代码

 <div class="idea">
 <i class="fa fa-lightbulb-o fa-lg popover-img" data-content="<%= cl_image_tag(@hiragana.upload, :width => 260, :height => 340) %>"></i>
 </div>

这里是js弹出框代码

  <script >
      $(document).ready(function(){
        $(".popover-img").popover({
          html: true,
          trigger: "hover",
          content: "",
          placement:'bottom'
        });
      })
    </script>

【问题讨论】:

  • 你能告诉我们生成的 HTML 吗?
  • 要么您向我们展示了您的 erb 文件中写入的内容,要么您没有使用 erb 文件,您应该这样做。
  • @JustinWood 是的,这里是 erb.html 文件,我只使用 js 和 erb.html 文件的代码,因为我想在我创建的每个显示视图上生成不同的图片。
  • 我们希望看到 erb 文件生成的 HTML。
  • @JustinWood 我不明白这里是显示在我的显示视图上的代码 Html.erb 您想查看新表单视图吗? Html 混合在我的 ruby​​ 代码中。

标签: ruby image twitter-bootstrap popover


【解决方案1】:

&lt;div type="button" class="fa fa-lightbulb-o fa-lg popover-img" data-toggle="popover" title="" data-content=&lt;%=cl_image_tag(@hiragana.upload, :width =&gt; 260, :height =&gt; 340)%&gt; &gt; contenu de ce que je dois cliquer dessu pour afficher le popover&lt;/div&gt;

【讨论】:

  • data-content=&lt;%="#{cl_image_tag(@hiragana.upload, :width =&gt; 260, :height =&gt; 340)}"%&gt;
猜你喜欢
  • 1970-01-01
  • 2012-11-09
  • 2021-03-07
  • 2020-08-17
  • 2018-05-10
  • 1970-01-01
  • 2014-05-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多