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

Ruby

Heroku with JS-Routes Issue

I'm running into issues pushing to Heroku now that I'm using the JS-Routes gem. In order to utilize JS-Routes I've set precompile to =true. However, this brings up an error when pushing to Heroku. Is there a way to successfully make Heroku and JS-Routes play nicely together?

1 Answer

Having the exact same issue, found this on another site so gonna give it a go!

I use workaround. Pre-generate routes in dev env.

Add js routes into development group in Gemfile.

Then fix initializer:

if defined?(JsRoutes) JsRoutes.setup do |config| config.include = [/item/] config.default_url_options = {:locale => I18n.locale} end end Then run rake js:routes to generate js file. And finally add app/assets/javascripts/routes.js into repo