nannigan/catsplurty — pull request #1 by kenmazaika (2014-09-18 00:13:57+00:00)
Title: Fix application.js

Hey Nan -

I just spent some time fixing your application and it was particularly tricky to debug. You almost stumped me, you should be impressed :).

So the first question that I had was basically why was the problem working on localhost, but failing on heroku. I got down to the bottom of it, and the key difference is this particular line:

https://github.com/kenmazaika/catsplurty/blob/master/config/environments/development.rb#L28

This line makes it so asset files (javascript, stylesheets, etc) are not compiled into a single file the same way that happens on production. That line makes it easier to debug issues, but causes performance problems so it's not enabled on heroku.

What I believe was happening on localhost is because that debug line was enabled, even though there was a slight problem with `application.js` it still worked because it just sort of skipped over the problem. On production the problem caused the javascript to screach to a halt.

The problem we had was including this line in the file:

```
//= require bootstrap
``

If you look carefully at the documentation here: https://github.com/twbs/bootstrap-sass, on the javascript you only want to include the "bootstrap-sprockets", but in the CSS you happen to need both.

So I went ahead and removed that line and then things worked out.

So here is the code change you need to make to get your application churning along.

-----------------

As a side note, this is a GitHub pull request. This is how I can show you code that I think you should add to your project. It allows you to look at the code, you'll see the green code is code that's added and the red is code that's deleted. The "Files changed" tab will show you the code.

"Commits" will show you a listing of the individual commits I'm trying to send you. And this tab, the conversation tab you can use to communicate about the change.

If you want to suck in all this code into your project you can by pressing the green merge button. After you press the merge button, you'll have to update your web dev environment to have the latest updates from GitHub and to do that you can run this command:

```
git pull origin master
```

Hope this helps.

Aloha,
Ken