Help with cross information between different websites

12 views
Skip to first unread message

Rodrigo Ruiz

unread,
Jun 30, 2011, 4:45:26 PM6/30/11
to rubyonra...@googlegroups.com
Hi everyone, I'm developing an application that involves 3 websites: one for the clients, one for other companies (kinda like other type of client), and one the admin.

I'd like to know how to get information from each an manipulate, for example: I want to get the number of clicks on a link in the menu of the clients website, and wanna display this information at the companies website.

Thank you,
Rodrigo

Sergio Sergio

unread,
Jun 30, 2011, 6:37:09 PM6/30/11
to rubyonra...@googlegroups.com
It depends on the architecture of your project. You could have one database for the clients app and one for the companies app, and in the companies app project you could connect to both databases(companies and clients) and just query the clients database for information. That's one solution, as I mentioned, It all depends on the architecture

2011/6/30 Rodrigo Ruiz <rodrig...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Rodrigo Ruiz

unread,
Jun 30, 2011, 9:18:06 PM6/30/11
to rubyonra...@googlegroups.com
what is query? and I don't know if thats what you understood, but I thought about making the different websites in different projects

Chirag Singhal

unread,
Jul 1, 2011, 1:00:13 AM7/1/11
to rubyonra...@googlegroups.com
Hi Rogrigo

What Sergio is trying to say here is something like this:
1. You can have 3 different Rails apps for this, with 3 different databases. And then for the admin app, you can connect to the client app and company app database and pull information from there. For this, you will have to specify two other databases in your database.yml file, one with connection details of client app database and another with connection details for company app database.
Then either you can direct do sql queries on those databases or define corresponding models for the related tables in your admin app, and ask them to connect to right database. Using something like this in the model - "establish_connection 'company_database' "

2. Have 3 different Rails apps but use the same database for all three. Then you directly have access to all the company and client data in your admin app as well.
Reply all
Reply to author
Forward
0 new messages