Button click, rendering back to the same page

Hi All,

Am having a lot of trouble trying to solve a very simple problem.

I have a button on my form which when clicked needs to do a quick
calculation then returns back to the same page to show the result.

VIEW.

<%=button_to “How much could I potentially borrow?”, :action =>
“newmortgagecalc” %>

CONTROLLER

def newmortgagecalc

  • some calculations here *
    render
    end

What do I need to render in the controller method to get back to the
same page?

Thanks

Richie.

On Tue, Oct 26, 2010 at 3:40 PM, Creative Technologist <
[email protected]> wrote:

“newmortgagecalc” %>

CONTROLLER

def newmortgagecalc

  • some calculations here *
    render
    end

render :action => :same_as_the_view

but if th calculation is not persistend (wont be saved to the db), use a
js
function and make everything in the client side

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs