Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

can't get coffee script to work in treebook web application using Sublime Text 2 under: "Build a simple Ruby on Rails application project"

I'm using Sublime Text 2 as my text editor but when I open the "statuses.js.coffee" file won't show up in the editor in the bottom right hand corner as a coffeescript which it did for Jim the instructor in the video. The reason the coffee script was being edited was to perform this action using coffee script.

$ -> $('.status').hover (event) -> $(this).toggleClass("hover")

I save this in the statuses.js.coffee file and refresh my "treebook" page and it doesn't show the hover working for the "edit" and "delete" tabs. If anyone could help me out I'd really appreciate it. Also I wanted to say that Team Treehouse is awesome! I look forward to learning more and hopefully one day I can become a web developer/designer.

Thanks for your time.

Ian

3 Answers

Any update on this ? I have a similar problem except that my code works at the first instance of loading the index page.

The over works and it shows the edit and delete option but when I create a status or am directed back to it I doesn't work then.

Stone Preston
Stone Preston
42,016 Points

did you add the required css?

Yes I did, and I even tried editing the elements part in chrome by adding div="class hover"> but it won't save. I can't get the hover code to work when you mouse over the words "edit and delete". I think the main issue is that sublime text 2 isn't reading my "statuses.js.coffee" as a coffee script because it doesn't show up in the bottom right hand corner as a "coffee script" and there is no option to change it to that. I changed it to javascript and javascript rails but no luck. Any other ideas?

Nachiket Kumar
Nachiket Kumar
3,590 Points

Do you have package control installed in Sublime Text? If so, you can install the CoffeeScript Plugin, and also tell ST to 'open all with current extension as' --> "CoffeeScript" (in bottom right corner). However I think this is only for syntax highlighting, and I suspect your issue is due to some other reason.

Thx Nachiket! I was able to download a coffee script plugin so ST2 can now read coffee script and it shows up (in the button right hand corner) but for some reason it still isn't working. I'll have to watch the video again and see what I missed. Thanks for your help.