Forum: Ruby on Rails POST or ActiveRecord save?

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.
Mohit S. (Guest)
on 2007-07-25 12:07
(Received via mailing list)
Hi, I have an application in which I'm generating data on my PC at work
and then sending it to a shared hosting site where a Rails application
shares it out to the world.

I have 2 options for forwarding the data from my PC to the Rails
application on the server:
1. Have a controller action in the Rails app that accepts the data
through a POST operations
   e.g. POST data to something like -
http://example.org/data/receive_from_client

2. Since the data on my PC is generated by a Ruby script, it's equally
easy for me to use the development version of the same Rails app and use
ActiveRecord with the database.yml properties set for the database used
by the Rails app and save it to the database direct without going
through the Rails application.

Is there any benefit in using one over the other?  For example, does #2
leave my Rails application appearing more responsive since it doesn't
use the application thread?  Or am I just thinking too much?

Cheers,
Mohit.
7/25/2007 | 3:46 PM.
Jeff E. (Guest)
on 2007-07-25 18:53
(Received via mailing list)
I'd say either way is fine, but IMO method #1 gives you the advantage
of being able to update the production server from anywhere, not just
your work PC.
This topic is locked and can not be replied to.