not getting a page reload when submitting a form on a page

Posted by Bob Walsh on Stack Overflow See other posts from Stack Overflow or by Bob Walsh
Published on 2010-03-23T00:55:49Z Indexed on 2010/03/23 1:01 UTC
Read the original article Hit count: 328

Filed under:
|

When showing a project, the user can add a decision via a form_for and its partial. Is there some way of avoiding reloading the page and just creating the record silently? In the controller method (adddecision) I have:

respond_to do |format|
      if @decision.save
        format.html { redirect_to(@project) }
        format.xml  { head :ok }
      else
        format.html { render :action => "show" }
        format.xml  { render :xml => decision.errors, :status => :unprocessable_entity }
      end

I've tried redirect_to(:back) etc - still getting a page reload.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about redirect