Brain
Brain

Reputation: 69

how to do nothing users when user date is expired on RoR?

hi guys i don't know how to do it? my web users date's expired then that users can't anything on my web. i'm using RoR 4. my web consist user and product model. product model consist CRUD. and user model date is more than Now time. it's expired then that user do nothing that model. how to solve this. sorry my english skill

Upvotes: 0

Views: 75

Answers (1)

rhernando
rhernando

Reputation: 1071

You can set a before_filter in ApplicationController (or ProductController) so if the date is expired it redirects user to an error/config/... page

If you expect your app to grow, you may consider using something like CanCan to manage permissions, so you can control more cases in the future

Upvotes: 1

Related Questions