I am building my first rails application and I expect it to eventually have many models/controllers. And of course they each have an ID associated with them. I can see that they are starting to get confusion already.
In the users controller the field is called id, but in every other controller i label it as user_id. When a controller is manipulating multiple models or calling actions in other controllers, it seems tedious to keep all the ids straight.
I would like to just prefix them all to be explicit, but am afraid this might cause errors down the road as user does not actually have a user_id field. This would be an issue when using something like update_attributes!.
Has anyone else experience this problem? Is it really a problem or am I making this into a bigger issue than it actually is? Are there any standard best practices for naming the id field?
Thanks! Dave