Re: [Rails] Simpleton routes

21 views
Skip to first unread message

Hassan Schroeder

unread,
Sep 16, 2012, 8:52:27 AM9/16/12
to rubyonra...@googlegroups.com
On Sat, Sep 15, 2012 at 8:57 PM, Joshua Niehus <jm.n...@gmail.com> wrote:
> Is there some way to keep rails from trying to open a page on a route?
> Basically I just want to send an ajax query to:
> http://localhost:3000/method/multiply?num1=3&num2=4
>
> while staying on http://localhost:3000/index

See: http://guides.rubyonrails.org/layouts_and_rendering.html

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Joshua Niehus

unread,
Sep 16, 2012, 11:55:35 PM9/16/12
to rubyonra...@googlegroups.com
None of those seem to help, Rails just goes to some blank page with either:
a) render :nothing => true 
b) head (blah blah...)

I have an ajax request for the server to check something for me but i do not want to be redirected anywhere when I call it...
not to a blank page or some generated template page, I just want the text response

Hassan Schroeder

unread,
Sep 17, 2012, 1:25:30 AM9/17/12
to rubyonra...@googlegroups.com
On Sun, Sep 16, 2012 at 8:55 PM, Joshua Niehus <jm.n...@gmail.com> wrote:
> None of those seem to help, Rails just goes to some blank page

Actually, your app goes to some blank page. The guide I linked to
earlier explains how to control that :-)

If that's not enough, post your request code and the corresponding
method from your controller.

Joshua Niehus

unread,
Sep 17, 2012, 11:52:27 AM9/17/12
to rubyonra...@googlegroups.com
Indeed, you are right! I saw what I was doing wrong. 

Thank you, 
Josh
"In your wisdom, I am humbled"
Reply all
Reply to author
Forward
0 new messages