Ruby on Rails教程删除用户在heroku上不起作用 [英] Ruby on Rails Tutorial Delete user does not work on heroku

查看:111
本文介绍了Ruby on Rails教程删除用户在heroku上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注Michael Hartl的Ruby on Rails教程(3.2)。在第9章中介绍了通过管理员用户功能删除用户。这在我的本地机器上工作正常,但不在heroku上。尽管生成的HTML在本地和在heroku上都是相同的

 < a href =/ users / 2data-confirm = 你确定? data-method =delete =nofollow>删除< / a> 

当我点击本地删除链接时,我确认弹出窗口?并在点击确定后删除用户。然而,当我单击删除链接时,在heroku上使用相同的代码,它会将我带到该用户的用户页面,而不是弹出确定的页面。消息。

有人可以引导吗?



我的application.js有以下条目

  // =需要jquery_ujs 
// =需要引导
// =需要jquery
// = require_tree。

我试图改变顺序如下,但没有成功

  // =需要引导程序
// =需要jquery
// =需要jquery_ujs
// = require_tree。


解决方案

问题。但是我找到了解决方案(而非解决方法)。

不幸的是,同样的application.js在我的本地设置和heroku上都不起作用。以下订单适用于heroku

  // =需要jquery 
// =需要jquery_ujs
// =需要bootstrap
// = require_tree。

下面的命令在我的本地安装程序中工作,否则我运行以描述线程 twitter引导下拉突然不工作

  // =需要jquery_ujs 
// =需要引导程序
// =需要jquery
// = require_tree。


I am following Ruby on Rails Tutorial (3.2) by Michael Hartl. In chapter 9 delete user by admin user functionality is introduced. This is working fine on my local machine but not on heroku. Though the generated HTML is same both locally and on heroku

<a href="/users/2" data-confirm="You sure?" data-method="delete" rel="nofollow">delete</a>

When I click delete link locally I get popup with you sure? and on clicking OK it deletes the user. However with same code on heroku when I click delete link, it takes me to user page of that user instead of pop up with you sure? message.

Can someone please guide?

My application.js had following entries

//= require jquery_ujs
//= require bootstrap
//= require jquery
//= require_tree .

I tried to change the order as below with no success

//= require bootstrap
//= require jquery
//= require jquery_ujs
//= require_tree .

解决方案

I had done assets:precompile already so that was not the issue. However I have found the solution (rather a workaround)

Unfortunately same application.js does not work on both my local setup and on heroku. Following order works on heroku

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .

Where as following order works on my local setup otherwise I run in to issue described in thread twitter bootstrap drop down suddenly not working

//= require jquery_ujs
//= require bootstrap
//= require jquery
//= require_tree .

这篇关于Ruby on Rails教程删除用户在heroku上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆