Hello guys,
I am trying to figure out how can I connect to a
remote database and retrieve information through a rails application.
I did something like this but didnt work.
I am running rails application on sqlite3 database in my local machine
and I am trying to connect to a remote database which is a postgresql
one.
I put this code in my application controller-----
Why put code overwritting AR::B in your controller?
I would create a model representing the external data and use the
method establish_connection :foo. Where foo is defined in your
database.yml file.
when you are trying to create a app just add these line -d mysql you will get the yml according to mysql and change the username and password according to your mysql password.
when you are trying to create a app just add these line -d mysql you will
get the yml according to mysql and change the username and password
according to your mysql password.
If you have already created the app and want to change it to mysql
then create a new app as Keerhi has suggested
rails new test_app -d mysql
then you can look at database.yml and see what is required.
when you are trying to create a app just add these line -d mysql you will
get the yml according to mysql and change the username and password
according to your mysql password.
If you have already created the app and want to change it to mysql
then create a new app as Keerhi has suggested
rails new test_app -d mysql
then you can look at database.yml and see what is required.
Colin
Also look at the Gemfile in the new app to see the gem changes required.
when you are trying to create a app just add these line -d mysql you
will
get the yml according to mysql and change the username and password
according to your mysql password.
Thanks ...changing user n apssword is not issue...but it indirectly
creating databse as appname_database...and it causing error..please
provide Solution..
Thanks for your help...
I think you need to try to explain the problem again, it is not clear
what your issue is. It might help if you post the full error message
you are getting. Also post database.yml.