UPDATE: User can now manually specify actionUrl. Duplicate code for URL computation removed