否“摧毁”从Heroku上运行Ruby / Rails应用程序的确认 [英] No "Destroy" confirmation from Browser running Ruby/Rails app on Heroku

查看:117
本文介绍了否“摧毁”从Heroku上运行Ruby / Rails应用程序的确认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有趣的问题...我创建了一个小型的Ruby on Rails应用程序,它可以在localhost:3000上正常工作,但是当我将它放在Heroku上时,我放弃了用脚手架Destroy链接销毁记录的能力

不同的行为是,当我在localHost:3000上运行时,我得到一个如下所示的浏览器对话框:





当我在heroku上运行时,我没有看到对话框,Destroy也没有。我在Safari和Firefox下运行的时候有相同的行为。



有什么想法吗?

解决方案预编译资产是否有帮助?



在config / environments / production.rb中设置

  config.assets.compile = true 

本地运行

  RAILS_ENV =生产包exec rake资产:预编译
git add。
git commit -am'预编译资产'
git push heroku master


Interesting problem... I have created a small Ruby on Rails app that works just fine on localhost:3000 with SQLite but when I put it up on Heroku I loose the ability to destroy records with the scaffolded "Destroy" link for the table.

The behavior that is different is that when I am running on the localHost:3000 I get a browser dialog that looks like this:

When I run on heroku, I don't get the dialog and the "Destroy" doesn't nothing. I am running under Safari and Firefox with the same behavior.

Any thoughts?

解决方案

Does precompiling the assets help?

In config/environments/production.rb set

config.assets.compile = true

locally run

RAILS_ENV=production bundle exec rake assets:precompile
git add .
git commit -am 'precompiled assets'
git push heroku master

这篇关于否“摧毁”从Heroku上运行Ruby / Rails应用程序的确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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