Add getQuery function in Edit / Actions / Show controllers

See issue #682