khalidh
khalidh

Reputation: 883

how to update columns in one application databse to another application database column using rails

I am new to rails. using mysql database, i have 2 rails application, that 2 applications running same time with different ports numbers. Eexample one app in localhost:3000 another app in localhost:4000.. in 2 applications i have different database name, and different tables. take 1st application it contains notedb databse, notebooks table, in notebooks table it contains cost column. 2 application contains textbooks table, in textbooks table it contains also cost column. My question is, in 1st application when i add or update cost column it save in first application cost column and also 2nd application cost column. please help me i am new to ruby on rails. i am using rails 4.2.6, please give complete reference. i am new ruby and ruby on rails, please write some code or give me the code link..

1st app database.yml

default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: mypassword
socket: /var/run/mysqld/mysqld.sock

development: <<: *default database: notebookdb

# Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: notebookdb

2nd app database.yml

default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: mypassword
socket: /var/run/mysqld/mysqld.sock

development: <<: *default database: textbookdb

# Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: textbookdb

Upvotes: 2

Views: 62

Answers (1)

Elayaraja Dev
Elayaraja Dev

Reputation: 208

You have to write API request call from your one application to another application and update column.

Upvotes: 2

Related Questions