小编Abh*_*dip的帖子

在rails应用程序的link_to标记中添加工具提示

我在index.html.erb页面上有一个链接.它是一个下载链接.现在我希望如果光标悬停在链接上,那么将显示工具提示文本.我已经尝试了几种组合,但还没有得到解决方案.

我的代码在这里:

<p>
Download:
<%= link_to "CSV", users_export_path(format: "csv") %> |
<%= link_to "Excel",users_export_path(format: "xls") %>
</p>
Run Code Online (Sandbox Code Playgroud)

我安装了bootstrap,我想为这两个链接生成bootstrap工具提示.请告诉我该怎么做以及正确的语法.

forms jquery ruby-on-rails tooltip twitter-bootstrap

3
推荐指数
1
解决办法
3485
查看次数

关于响应式数据表的问题

我在rails webapp上有一个现有的ruby,我使用Bootstrap 3使其完全响应并满足其他样式要求.现在我的一些网页包含数据表.由于我的webapp完全响应,因此当我在移动设备中打开我的webapp时,数据表适合小屏幕,水平滚动条位于底部.但我不需要这个功能.我需要使用较小的字体和没有水平滚动条的整个表格.

有没有办法使用媒体查询和任何其他技巧来实现这一目标?

请帮我解决这个问题.

提前致谢!!!

我的数据表如下:

<table class="table table-striped table-hover" id="indentdatesort">
<thead>
<tr>

  <th>Indent No.</th>
  <th>Warehouse</th>
  <th>Item</th>
  <th>Make/Catno</th>
  <th>UOM</th>
  <th>Qty</th>
  <th>Qty P</th>
  <th>Sh Cl</th>
  <th>Date</th>
  <th>SortDate</th>
  <th>Rqt Dt</th>
  <th>Sort Rqt Dt</th>
  <th>Cost Centre</th>
  <th>Remarks</th>
  <th>By</th>
  <th>Entry</th>
  <th></th>


  </tr>
</thead>

<tbody>
  <tr>

    <td>INDMSF/16-17/00002</td>

    <td>Furnace</td>
    <td>Cotton Hand Gloves</td>

    <td></td>

    <td>pair</td>
    <td>12.0</td>

    <td>0.0</td>
    <td></td>
    <td>25/06/16</td>
    <td>06/25/16</td>

    <td>25/06/16</td>
    <td>06/25/16</td>

    <td>Kiln . Kiln 1 . Girth Gear</td>

    <td></td>
    <td>Ashfaque</td>
    <td>Ayush Jhunjhunwala</td>
    <td><input class="btn btn-default btn-xs" name="154" type="submit" value="&gt;" /></td>
  </tr>
  <tr>

    <td>INDMSF/16-17/00003</td>

    <td>Furnace</td>
    <td>Bearing …
Run Code Online (Sandbox Code Playgroud)

html ruby-on-rails datatables responsive-design twitter-bootstrap-3

2
推荐指数
1
解决办法
871
查看次数

无法解析getElementById中的字符串

我在我的应用程序中使用jquery,我在rails上使用ruby.现在我想在输入过程中立即在搜索框中输入数据.一切正常,但问题是它无法捕获特殊字符等#@$&()%.它适用于所有其他数字和字母表.我正在使用getElementById技术从文本框中获取数据.

请告诉我解决这个问题的任何解决方案

我的jquery代码部分是:

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>


<link rel="stylesheet" href="/resources/demos/style.css">
<script>


$(document).ready(function(){
$("input").keyup(function(){
    var box = document.getElementById("tags");
    document.getElementById("abc").innerHTML = box.value;
    $.getScript('/employees/new?pt=' + box.value)
});
});
</script>
Run Code Online (Sandbox Code Playgroud)

实际上我想将这个捕获的数据从文本框发送到我的rails控制器.我的控制器名称是员工,行动是新的

javascript jquery getelementbyid

0
推荐指数
1
解决办法
132
查看次数