apply rails3 rest style.