2

I have a Rails controller, lets call it UsersController. It has the standard new, edit, show, index pages.

Rails convention creates a js file for use with this controller in /assets/javascripts/users.js. The problem is, this file is now a few thousand lines long. That sucks since it's not even page specific. Despite sparkling code and organization, the size of it makes it very difficult to navigate / read.

I'm assuming any application of reasonable size runs into this. There are a lot of questions about doing "per page" javascript files. But I just want to know, does Rails have a convention for this or not?

dertkw
  • 7,798
  • 5
  • 37
  • 45
Don P
  • 60,113
  • 114
  • 300
  • 432
  • Rails doesn't have a convention for "per page" assets. You might find this discussion helpful http://stackoverflow.com/questions/6167805/using-rails-3-1-where-do-you-put-your-page-specific-javascript-code – Hoa Oct 12 '14 at 12:25

0 Answers0