changed to elsif params[:method] == 'post'