Forum: Ruby on Rails AJAX & Posting Reccomendation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
tyler (Guest)
on 2006-03-24 17:15
I'm currently developing a photo gallery website with Rails.  Each photo
can be commented upon.  What I'd like to do is, once the user posts a
comment, use AJAX to submit the comment and then automatically update
the page with the comment the user just submitted.

I also don't want to use Prototype or the built in AJAX that comes with
Rails... it's too fat for what I need.  I can write the javascript to
handle this without a problem.

If this were in PHP/Perl, I'd just use javascript to post the data to a
php/cgi file.  However, I'm a little  unsure of the best way to approach
this with Rails.  Would I create a controller just for this?
myurl.com/photos/addcomment and post to that controller... or?

Any suggestions?

Thanks in advance
tyler
Emin H. (Guest)
on 2006-03-24 21:33
(Received via mailing list)
You don't need separate controller - action in existing controller is
enough. Just make sure that action does not use layouts and only
responds
with the required data that can be processed by javascript
This topic is locked and can not be replied to.