[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: AJAX without Rails

Deepak Vohra

11/20/2007 6:07:00 PM

Note: parts of this message were removed by the gateway to make it a legal Usenet post.

Ruby on Rails is the only Ajax framework for Ruby.
http://ajaxpatterns.org/Ruby_Ajax_...

Miki Vz <mikisvaz@yahoo.com> wrote:
Isn't this precisely a rails tutorial? I'm trying not to use rails,
since I really have no database or anything.


Deepak Vohra wrote:
> http://www.regdeveloper.co.uk/2007/01/15/ajax_rails...
>
> Miki Vz wrote: Actually, I'm not sure I'm using
> eruby, I'm using mod_ruby and
> generating the html with markaby. I'm a bit lost with all the technology
> :p.

--
Posted via http://www.ruby-....



16 Answers

Miki Vz

11/20/2007 6:12:00 PM

0

:'(. Ok then, thanx.

Deepak Vohra wrote:
> Ruby on Rails is the only Ajax framework for Ruby.
> http://ajaxpatterns.org/Ruby_Ajax_...
>
> Miki Vz <mikisvaz@yahoo.com> wrote:
> Isn't this precisely a rails tutorial? I'm trying not to use rails,
> since I really have no database or anything.

--
Posted via http://www.ruby-....

Alex Young

11/20/2007 6:15:00 PM

0

Deepak Vohra wrote:
> Ruby on Rails is the only Ajax framework for Ruby.
> http://ajaxpatterns.org/Ruby_Ajax_...
I don't think that's quite true - doesn't Nitro have AJAX support?

--
Alex

>
> Miki Vz <mikisvaz@yahoo.com> wrote:
> Isn't this precisely a rails tutorial? I'm trying not to use rails,
> since I really have no database or anything.
>
>
> Deepak Vohra wrote:
>> http://www.regdeveloper.co.uk/2007/01/15/ajax_rails...
>>
>> Miki Vz wrote: Actually, I'm not sure I'm using
>> eruby, I'm using mod_ruby and
>> generating the html with markaby. I'm a bit lost with all the technology
>> :p.
>


John Joyce

11/21/2007 1:55:00 AM

0

AJAX is simply what the name implies:
Asynchronous Javascript And Xml
It means using Javascript for DOM scripting (changing the structure
of the document or web page) and using Javascript to send xml
requests to a remote location (the server the site comes from)
That's it.
You can implement AJAX with or without Rails.
With or without Ruby.
Ruby and AJAX are not aware of each other.
Ruby is on the server responding to requests.
Javascript and html are sent to the client.
Javascript can send requests to the server.

You can totally do this without Rails or Nitro or whatever.
It is about serving pages with Javascript in them.
Check out Scriptaculous, Prototype, Mochikit, etc...
On Nov 20, 2007, at 12:14 PM, Alex Young wrote:

> Deepak Vohra wrote:
>> Ruby on Rails is the only Ajax framework for Ruby.
>> http://ajaxpatterns.org/Ruby_Ajax_...
> I don't think that's quite true - doesn't Nitro have AJAX support?
>
> --
> Alex
>
>> Miki Vz <mikisvaz@yahoo.com> wrote:
>> Isn't this precisely a rails tutorial? I'm trying not to use
>> rails, since I really have no database or anything.
>> Deepak Vohra wrote:
>>> http://www.regdeveloper.co.uk/2007/01/15/ajax_rails...
>>>
>>> Miki Vz wrote: Actually, I'm not sure I'm using eruby, I'm using
>>> mod_ruby and
>>> generating the html with markaby. I'm a bit lost with all the
>>> technology
>>> :p.
>
>


Alex Young

11/21/2007 8:58:00 AM

0

John Joyce wrote:
> AJAX is simply what the name implies:
> Asynchronous Javascript And Xml
> It means using Javascript for DOM scripting (changing the structure of
> the document or web page) and using Javascript to send xml requests to a
> remote location (the server the site comes from)
> That's it.
> You can implement AJAX with or without Rails.
> With or without Ruby.
> Ruby and AJAX are not aware of each other.
> Ruby is on the server responding to requests.
> Javascript and html are sent to the client.
> Javascript can send requests to the server.
>
> You can totally do this without Rails or Nitro or whatever.
> It is about serving pages with Javascript in them.
> Check out Scriptaculous, Prototype, Mochikit, etc...
This is true; however I understood the question to be asking whether
there were any Ruby frameworks that specifically help with the
server-side part of the equation. Rails' integration with Scriptaculous
and Prototype is one example, but the OP mentioned that wasn't
appropriate. I was attempting to provide an alternative - I understand
that Nitro's AJAX support is comparable.

--
Alex

> On Nov 20, 2007, at 12:14 PM, Alex Young wrote:
>
>> Deepak Vohra wrote:
>>> Ruby on Rails is the only Ajax framework for Ruby.
>>> http://ajaxpatterns.org/Ruby_Ajax_...
>> I don't think that's quite true - doesn't Nitro have AJAX support?
>>
>> --
>> Alex
>>
>>> Miki Vz <mikisvaz@yahoo.com> wrote:
>>> Isn't this precisely a rails tutorial? I'm trying not to use rails,
>>> since I really have no database or anything.
>>> Deepak Vohra wrote:
>>>> http://www.regdeveloper.co.uk/2007/01/15/ajax_rails...
>>>>
>>>> Miki Vz wrote: Actually, I'm not sure I'm using eruby, I'm using
>>>> mod_ruby and
>>>> generating the html with markaby. I'm a bit lost with all the
>>>> technology
>>>> :p.
>>
>>
>
>


Michael Neumann

11/21/2007 4:54:00 PM

0

Miki Vz schrieb:
> :'(. Ok then, thanx.

Keep smiling :)

AJAX can be so simple with just Mongrel (no Rails required at all!!!!!):

require 'rubygems'
require 'mongrel'
require 'json'

class AjaxHandler < Mongrel::HttpHandler
def process(req, res)
res.start(200) do |header, out|
out << JSON.dump({"Hello" => "AJAX!"})
end
end
end

Mongrel::Configurator.new :host => '127.0.0.1' do
listener :port => 5000 do
uri '/', :handler => AjaxHandler.new
run
join
end
end


All you need are the 'json' and 'mongrel' gems. In your HTML page simply use
jquery (www.jquery.com), and make a AJAX call to the server. That's so easy!

Regards,

Michael


Miki Vz

11/21/2007 8:56:00 PM

0

Thanks a lot for your replies guys, I have a lot of information here to
digest but I think I know what to look for.

Miki
--
Posted via http://www.ruby-....

James Britt

11/22/2007

0

Alex Young wrote:
> Deepak Vohra wrote:
>> Ruby on Rails is the only Ajax framework for Ruby.

That's a laughable claim.

>> http://ajaxpatterns.org/Ruby_Ajax_...
> I don't think that's quite true - doesn't Nitro have AJAX support?


Yes.

And it's easy enough to do in Merb, Camping, Ramaze, et al if they do
not also have it baked in.

--
James Britt

"Every object obscures another object."
- Luis Bunuel

benjohn

11/27/2007 9:44:00 PM

0


On 22 Nov 2007, at 00:00, James Britt wrote:

> Alex Young wrote:
>> Deepak Vohra wrote:
>>> Ruby on Rails is the only Ajax framework for Ruby.
>
> That's a laughable claim.

That expression always makes me think of this:

http://xkc...





Tony De

3/18/2008 8:52:00 PM

0

Benjohn Barnes wrote:
> On 22 Nov 2007, at 00:00, James Britt wrote:
>
>> Alex Young wrote:
>>> Deepak Vohra wrote:
>>>> Ruby on Rails is the only Ajax framework for Ruby.
>>
>> That's a laughable claim.
>
> That expression always makes me think of this:
>
> http://xkc...

I just ran across this post. I am taking swimming lessons in Ruby,
Rails, AJAX, and the like. I was looking for some help on how to take
advantage of AJAX using Ruby. I'm wanting to start off simple with a
call to a cgi script which will pass data back to the page updating a
<div>. I found Michael Neumann's post of interest as I have zero Java
or Javascript experience. I'm an old salt at VB & Delphi coding Database
apps. I googled json as I didn't know what that was and also JQuery.
So I think this all sounds pretty cool. One question I have. Looking
at the JQuery info, it seems that all the page magic is coded into the
web page itself. I didn't see any info (perhaps that's not how JQuery
works) on accessing the DOM elements from a cgi or ruby code. My need
is to process one or more files on a syslog server for information and
pass the info back to the browser. I could use some clarification on
what I need to be looking for to accomplish this. Thanks so much for
any feedback you may have.

tonyd
--
Posted via http://www.ruby-....

Hassan Schroeder

3/18/2008 9:19:00 PM

0

On Tue, Mar 18, 2008 at 1:51 PM, Tony De <tonydema@gmail.com> wrote:

> ......................... it seems that all the page magic is coded into the
> web page itself. I didn't see any info (perhaps that's not how JQuery
> works) on accessing the DOM elements from a cgi or ruby code.

That's not how it works, period. JavaScript running in the browser
sends a request to a server process, which returns a response; it's
up to the in-page JS to handle the response appropriately.

But there's no way for the server to directly manipulate anything on
the client.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com