为什么私人酒吧会寻找一个js文件?(why does private pub look for a js file?)

编程入门 行业动态 更新时间:2024-10-23 21:25:33
为什么私人酒吧会寻找一个js文件?(why does private pub look for a js file?)

这是我的application.js文件

//= require jquery //= require jquery_ujs //= require foundation //= require private_pub //= require_tree .

我的private_pub.ru文件

development: server: "http://localhost:9292/tweets/create" secret_token: "secret" test: server: "http://localhost:9292/tweets/create" secret_token: "secret" production: server: "http://localhost:9292/tweets/create" secret_token: "89e004720af45e61a350a30cf7ee3f50163ca141a02ea130db0b5007a0b75058" signature_expiration: 3600 # one hour

我的页面的一部分想要订阅频道

<%= form_for @tweet, url: tweets_path, method: :post, remote: true do |f| %> <%= f.text_area :body, id: 'tweet-box', placeholder: "What's goin on..." %> <%= f.submit 'tweet', id: 'tweet-btn', class: 'button' %> <% end %> <div id="map-canvas" /> <%= subscribe_to '/'tweets/create' %>

我在tweets控制器中创建动作的create.js.erb文件

<% publish_to "/tweets/create" do %> var swBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%= @tweet.location.longitude %>) var neBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%= @tweet.location.longitude %>) var tweet_coords = new google.maps.LatLngBounds(swBound_tweet, neBound_tweet) var tweet_overlay = new Tweet(tweet_coords,"<%= @tweet.body %>", window.map) <% end %>

我用这个启动了faye服务器:

bundle exec rackup private_pub.ru -s thin -E development config.ru

也尝试过

bundle exec rackup private_pub.ru -s thin -E production config.ru

我在浏览器控制台中收到此错误:

GET http://localhost:9292/tweets/create.js 404 (Not Found)

我在faye服务器日志中收到此错误:

127.0.0.1 - - [25/Jan/2014 11:16:56] "GET /tweets/create.js HTTP/1.1" 404 767 0.1431

我已经在提到它的所有文件中多次更改了频道名称,但我仍然遇到同样的问题。 我在用着:

ruby - 2.0.0 rails - 3.2.13 faye - 1.0.1 private_pub - 1.0.3

我搜索了整个互联网,但找不到任何东西。请帮忙!

Here's my application.js file

//= require jquery //= require jquery_ujs //= require foundation //= require private_pub //= require_tree .

My private_pub.ru file

development: server: "http://localhost:9292/tweets/create" secret_token: "secret" test: server: "http://localhost:9292/tweets/create" secret_token: "secret" production: server: "http://localhost:9292/tweets/create" secret_token: "89e004720af45e61a350a30cf7ee3f50163ca141a02ea130db0b5007a0b75058" signature_expiration: 3600 # one hour

A part of my page which wants to subscribe to a channel

<%= form_for @tweet, url: tweets_path, method: :post, remote: true do |f| %> <%= f.text_area :body, id: 'tweet-box', placeholder: "What's goin on..." %> <%= f.submit 'tweet', id: 'tweet-btn', class: 'button' %> <% end %> <div id="map-canvas" /> <%= subscribe_to '/'tweets/create' %>

The create.js.erb file for my create action in the tweets controller

<% publish_to "/tweets/create" do %> var swBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%= @tweet.location.longitude %>) var neBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%= @tweet.location.longitude %>) var tweet_coords = new google.maps.LatLngBounds(swBound_tweet, neBound_tweet) var tweet_overlay = new Tweet(tweet_coords,"<%= @tweet.body %>", window.map) <% end %>

I started the faye server with this:

bundle exec rackup private_pub.ru -s thin -E development config.ru

also tried with

bundle exec rackup private_pub.ru -s thin -E production config.ru

I'm getting this error in the browser console:

GET http://localhost:9292/tweets/create.js 404 (Not Found)

I'm getting this error in the faye server logs:

127.0.0.1 - - [25/Jan/2014 11:16:56] "GET /tweets/create.js HTTP/1.1" 404 767 0.1431

I've changed the channel name several times in all the files where it is mentioned but I still get the same problem. I'm using:

ruby - 2.0.0 rails - 3.2.13 faye - 1.0.1 private_pub - 1.0.3

I've searched the entire internet but couldn't find anything.Please help!

最满意答案

我以某种方式解决了这个问题。 我在Windows 7上运行我的应用程序,突然它的工作完美。 实际上存在一个由localhost:9292提供的faye.js文件。 此外,我现在从rjs模板触发事件

I somehow fixed the problem. I ran my application on windows 7 and suddenly its working perfectly. There actually exists a faye.js file that is provided by localhost:9292. Also, I'm now trigger the events from an rjs template

更多推荐

本文发布于:2023-08-04 06:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1412584.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:私人   酒吧   文件   pub   file

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!