Convert cake's behavior as Rails