Hi, I have a custom class under my app folder that I would like to access the current users cookies at. Currently, I get an undefined method cookies error. Is there something I need to include in my class in order to access them?
Looking for a good resource or some tips: I have an admin panel in my Rails app. The admin panel was only available to the super admin, but now there is a new normal admin role. The normal admin will need access to an admin panel as well. What is the best practice: a) new view just for the new admin, or b) render different things on the existing view depending on which type of admin is accessing the page?
If I need to know current user information for a validation, should that validation be in the model or the controller? I have the custom validation in the model currently, but I'm having trouble getting the current user information because session info usually isn't available at that level.
validation, When users are logged in they have a role and certain roles can change values in a table only to other certain values depending on their role
e.g. someone with a 'developer' role could change state_id in a model from 0 to 1, but not from 1 to 2
Okay, thank you. I thought I was going down the wrong path. Where do I handle authorizations, the controller?
I'm asking because whenever I encountered some behavior I haven't come across before. I put a 'puts' in my application.rb within the Application class and created a basic rake task. Whenever I call rake something:easytask, whatever I have in the application class in application.rb is outputted
I'm not stuck on anything, currently. This gem describes what i'm doing https://github.com/nilbus/rails-app-versioning, but I wanted to see if the community had any better methods