Javascript not executing (I included format.js)

Posted by Brandon on Stack Overflow See other posts from Stack Overflow or by Brandon
Published on 2012-11-23T02:25:53Z Indexed on 2012/11/23 4:59 UTC
Read the original article Hit count: 124

I added format.js to my controller, yet I still cannot get the js in index.js.erb to execute when I view my index page. The only thing I can figure out is that it must be because of the model name. I had to add

ActiveSupport::Inflector.inflections do |inflect|
  inflect.irregular 'business', 'businesses'
end

to my inflections.rb file...because my model is called Business.

my views/js are located at views/businesses/*

Please help before I pull my hair out!

All I have in the index.js.erb file is:

alert(1);

Obviously the goal is that I will get an alert when I finally get the issue fixed, letting me know it is working.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3