RailsCasts Pro episodes are now free!

Learn more or hide this

Jason Perry's Profile

GitHub User: jperry

Comments by Jason Perry


I do have another issue though where I have other forms on the same page that I am refreshing data and when any of those buttons are pushed I sometime run into a situation where the request is killed. I think I may need to make those form submits into ajax calls as well. Does this sound right? By the way those other forms on the page make actual calls to external services so sometimes it's not instantaneous like it would be if I was using ActiveRecord like in your screencast. Thanks in advance for any help.


So it looks like I had two things missing which might help others. First my controller needed a "format.js" in the respond_to. The other is my request was being sent as html, so I had to switch the request to "$.ajax({ url: $('#group-instances').data('url'), dataType: "script" })" where group-instances was my id.


Just to provide more information I don't see something similar to yours where when on the article page you see a request coming in where it says:

Rendered comments/index.js.erb

Mine says something like:

Rendered environments/index.html.haml within layouts/application (1.2ms)


Hi Ryan,

Thanks for the great video. I am having an issue where the app/views/comments/index.js.erb isn't being executed for me. I am trying to implement this in my own project where I have a views called "environments" and that is the one I'm trying to poll for changes. The "environments" doesn't have the same relationship as your article and comments example basically on the environments index page I want to poll for changes but it doesn't seem the index.js.erb file is being executed. Any help would be much appreciated.