PaulL1 / league-tutorial

A tutorial with rails and angularjs, building a CRUD application
Other
23 stars 10 forks source link

Rails 4 Integration #2

Closed carpe171 closed 10 years ago

carpe171 commented 10 years ago

Hi Paul,

Thanks a ton for the tutorial, super helpful.

In Rails 4, the app's executables are now in a bin/ directory. This directory gets removed when running grunt build.

To get it to work I've commented out the Gruntile.js clean command:

     /**
     * The directories to delete when `grunt clean` is executed.
     */
    clean: [ 
      '<%= build_dir %>'
      // '<%= compile_dir %>'
    ],

but will it break in production? What would be the best solution?

Thanks,

Wade

PaulL1 commented 10 years ago

Wade,

I haven't been a long way into rails 4 as yet (although it's on my todo list). My suggestion would be to rename the grunt compile directory as something other than bin, rather than just commenting it out.

As I understand the scripts that came with ng-boilerplate (and that's where this bit came from) it builds to the build directory for development/test, and in doing that it doesn't minify or otherwise compress the files. For production it would compile those files into single minified files, and it would expect those to be in the bin directory. So if you just comment out the clean command you're still going to clobber your bin directory when you first run grunt compile. I presume the variable compile_dir is set to something that you could change - maybe to angular_bin or something - and then just do a general search through the grunt scripts to make sure that bin isn't hard coded anywhere by accident.

carpe171 commented 10 years ago

Excellent.

I'm working my way through your tutorial on Rails 4, and can jot down a few more hiccups as I go.

Thanks again for your work, really great stuff.

PaulL1 commented 10 years ago

Sounds great @carpe171, I have to deal with Rails 4 sometime soon, so would be useful to know what you found.

MattCowski commented 10 years ago

Had the same issue. Found the answer here: https://github.com/gruntjs/grunt/issues/919

@carpe171 How did you end up renaming the compile_dir? Any other changes that I need to do since I am also attempting this with rails 4.