Just curious about the best practices for Rails in where I put a custom constraints class that’s used as a constraint in config/routes.rb. Seems like Rails.root/lib is where all user classes go. Is that appropriate for this? Should I be creating a directory inside for constraints? 2 empty directories exist there now, assets and tasks. Are there conventions for this?
Just curious about the best practices for Rails in where I put a custom
Share
lib/would be the appropriate place. If you want to make it cleaner, put it inlib/constraint/authenticated.rband define your constraints like soand in your
routes.rb