I'm using form_remote_for() to do validation on a form's data so that my rails app can show the user errors without reloading the page. I'm having troubles redirecting the page if there are no errors. Here is my code:
def create
# Validate the data
if error_count > 0
render :update do |page|
page.replace_html(div_id, error_text)
end
else
# Save the data
redirect_to(page_to_go_to)
end
end
Everything in this method works fine except the redirect. The server claims it does a successful redirect and I believe it's the AJAX call that's being redirected. What I want to happen is have the page that contains the form to redirect. Is that possible?