RailsCasts Pro episodes are now free!

Learn more or hide this

Andrew Cockerham's Profile

GitHub User: andrewcockerham

Site: https://www.linkedin.com/in/andrewcockerham

Comments by Andrew Cockerham


The coffeescript in the episode didnt work for me (I was trying to have the grouped_collection_select in a nested form, not sure if that was part of the issue)

But in any case, this did work, hopefully it helps someone: (using different id tags as the ones in my project)

Note the main difference being how I called the filter action

jQuery ->
        items = $('#quantity_item_select').html()
        $('.supplier_select').change ->
                supplier = $('.supplier_select :selected').text()
                options = $(items).filter((index) ->
                  $(this).attr("label") is supplier)
                if options

I have the same issue. This SO question might help. However I haven't been able to get it to work myself.


I'm having the same issue. For some reason it seems that my new.js.erb file is not getting loaded. My new action in my controller does not have a respond_to block, although the create action does.

Why is it not loading?


I have the same question...does anyone know the answer?


I have the exact same problem you did. I tried your Tubrolinks suggestion, but it doesn't work.

Where did you add the 'data-no-turbolink' tag?

UPDATE: I have it working now - I had my answer_fields wrapped in a tag rather than a tag

Thanks for your post though, turbolinks is very cool!


I'm having the exact same problem. I tried Eric Wanchic's answers below regarding Turbolinks, but it didn't seem to help.

Since it's trying to execute the actual link to the '#' url, my guess is that for some reason the event.preventDefault() is not working because it is still trying to execute the link rather than running the javascript.

Anyone know how to fix it?


Ok, so I downloaded the source code, and when a survey is updated, the params are this:

"survey"=>{"name"=>"Rails Survey",
"commit"=>"Update Survey",

But I created a rails app from scratch following line by line in the railscast and I get an arror "Cannot convert Symbol into Integer" and my params are slightly different when updating a survey:

"survey"=>{"name"=>"Test 1",
"commit"=>"Update Survey",

So I have a feeling it has to do with the "0" that is before the "content" of "questions_attributes" in the source code params but not in my params. What am I doing wrong and how can I fix it?