Cmd line interface for ruby on rails app

Hi,

I have a rails app running which provides an interface to create/update
data stored in a DB. How do i develop a cmd line interface to do the
same i.e i should be able to retrieve/update data to a DB.

No need to do that, simply use rails console to interact with the DB
through Ruby/Rails.

On Wed, Jun 13, 2012 at 3:08 PM, cyber c. [email protected] wrote:

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

On Jun 13, 2012, at 3:46 PM, cyber c. wrote:

I think that wont serve my purpose, as i’m building a tool which will
help clients to update/create entries in the DB. You mean to say every
client has to use rails console and connect to the rails server?

You can load ActiveRecord and use it from within a RUBY app without
running a Rails server–is that what you mean?


Scott R.
[email protected]
http://www.elevated-dev.com/
(303) 722-0567 voice

On Wed, Jun 13, 2012 at 3:46 PM, cyber c. [email protected] wrote:

I think that wont serve my purpose, as i’m building a tool which will
help clients to update/create entries in the DB.

If you’re “building a tool”, what is the exact question? :slight_smile:


Hassan S. ------------------------ [email protected]

twitter: @hassan

I dont know how it works with out rails server. But what i have now is
a) browser based interface to DB to edit/view the records
b) Clients can access this remotely

What i want is
a) cmd line interface (using a ruby script ?) , so that remote clients
can use this app/script to interface with the DB

Hi Miguel,

I think that wont serve my purpose, as i’m building a tool which will
help clients to update/create entries in the DB. You mean to say every
client has to use rails console and connect to the rails server?

Well,

That’s why you create APIs for your services.
If you’re developing a mobile client for example you need to developer a
REST API.
So, I recommend you look into building a JSON API and have your command
line interact w/ it if that’s the way you want to go.
But, I don’t see a point to having a command line interface when a
browser
is usually a more powerful way of interacting w/ services.

On Wed, Jun 13, 2012 at 4:28 PM, Hassan S. <
[email protected]> wrote:

strings – to the server, right? So define your command line syntax,


You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

On Wed, Jun 13, 2012 at 4:11 PM, cyber c. [email protected] wrote:

I dont know how it works with out rails server. But what i have now is
a) browser based interface to DB to edit/view the records
b) Clients can access this remotely

What i want is
a) cmd line interface (using a ruby script ?) , so that remote clients
can use this app/script to interface with the DB

You do understand that a browser works by sending “requests” –
strings – to the server, right? So define your command line syntax,
write the code to take the input and send it to the Rails server like a
browser, and handle the server’s response appropriately.

Or teach your clients to use Lynx - might be less work :slight_smile:

FWIW,

Hassan S. ------------------------ [email protected]

twitter: @hassan