我正在看这个页面(http://lesseverything.com/blog/archives/2012/07/18/customizing-confirmation-dialog-in-rails/)它显示了一些代码,但我不明白我是怎么做的可以实现它到我的应用程序.
我使用Rails3.2,Bootstrap.css和JQuery.
有人能告诉我究竟需要做些什么来显示带有bootstrap模式的"删除确认对话框"吗?
更新:
资产/ Java脚本/ application.js中
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
// …
Run Code Online (Sandbox Code Playgroud) 假设用户在网站上花了很长时间.
如何获取用户上次活动时间.上次活动时间表示请求(访问该页面.用户甚至不需要更新或创建新记录)到应用程序的用户的最后时间戳.
用户可能在大约一小时前签约.然后他仍然在我的网站上网冲浪.我想要用户发送的最后一次请求的时间.
可能吗?
设计有current_sign_in_at但不是最后一个活动时间.
我正在使用很多宝石.他们对依赖关系非常敏感.
现在,宝石的当前组合是完美的.我想保存整个App,并在下一个项目时重新使用它.
如你所知,宝石未来都不会存在.rubygem.org
所以我想保存正在使用的App和宝石的整个包.除非我需要新宝石,否则我不需要关心设置宝石.我需要关心的只是在下一个项目中进行编码.
有人告诉我使用此命令并保存整个App文件夹
bundle install --path=vendor/bundle
Run Code Online (Sandbox Code Playgroud)
在此之后,我的应用程序被搞砸了:( jQuery之后不再工作了 recompile
所以我确实需要用旧版本替换整个App文件夹,这对于创建了宝石 /usr/local/bin/ruby /usr/local/lib/ruby/gems/1.9.1
现在,jQuery
工作正常recompile
:)
对于这种情况,我如何保存用于它的App和gem的整个包?
我想做的是,我只想设置Ruby的正确版本和MySQL.
然后我想把这个包装进去并开始编码,而不是部署宝石的环境!!
有人可以分享一下这个想法吗?
是否可以获取发布新记录的用户的MAC地址?
如果我调用了列mac_address
,如何编写控制器以将MAC地址放入该列?
我有一个名为Genre的模型
存储了许多记录.
我试图从Genres表中获取所有记录,并在select中显示所有记录.请参阅下面我在视图中编码的内容.
但这会像这样返回错误.我怎么解决这个问题?
undefined方法`map':id:符号
我的看法
<%= form_tag communities_path, :method => :get, :class => 'form-search' do %>
<div class="input-append">
<%= form.collection_select :id, Genre.all, :id, :name %>
<button type="submit" class="btn">Search</button>
</div>
<% end %>
Run Code Online (Sandbox Code Playgroud)