Topic: Provide a service and Develop applications with Ajax

Hi there.

I'm thinking in developing a comercial online application
to provide a service instead of doing a desktop software.
But i would like to know how to do it...
The database will have many tables; so i would have a separate
database and rails application directory for each client?
How to develop an application like Basecamp or so?

Another doubt is about develop applications with Ajax:
How could i develop an application in the "normal way"
and that as, at the same time, suport to AJAX for every action?

Thanks
Tim

PS: Sorry for my english

Re: Provide a service and Develop applications with Ajax

I built a similar application, and there's no need to create separate databases.  You just need to add another layer.  For example you could create a shops table, and then add a shop_id field to your products and categories and such.  Of course you'll have to be very carefull with security, otherwise people may accidently or intentionally get access to other peoples information.

Rails has many was of supporting Ajax degrading.  When creating a link using link_to_remote(an ajax link), you can specify an :href parameter.  If the users doesn't have javascript support, the browser will be forwarded to the url in the href parameter.  You can also use the request.xhr?  to determine if the request can through XMLHttpRequest(ajax).

What you are trying to do is very possible.  It might help if you asked more specific questions though.

Re: Provide a service and Develop applications with Ajax

First thank you for the reply.

I will check more about the AJAX subject.
But with AJAX and PHP or other server side language,
there is plenty of javascript work.
When developing AJAX with Rails, there isn't that need?
Rails does the work for us... or we must create javascript
files to handle the client request and show the response
to the client that Rails generated?

About the development of a comercial application...
So, for almost every table we must set a id_client
for each client?
There isn't a better or other solutions?

Thanks

Re: Provide a service and Develop applications with Ajax

Rails includes Prototype Helper Methods that make most Ajax coding super easy.  When that's not enough you can use Rails' RJS templates.

About the development of a comercial application...
So, for almost every table we must set a id_client
for each client?
There isn't a better or other solutions?

I've not heard of a better solution, and I'm not sure why it wouldn't be acceptable.

Last edited by thabenksta (2006-08-04 10:07:02)

Re: Provide a service and Develop applications with Ajax

About the id column for identify different clients:

I will have a service that is provided for many clients/companies.
For example, there will be the following tables: "companies", "employees" and "courses".
So, a company subscribe my service; each company will have on or more employees that login to the service and could create, update... many courses. Table "courses" will have a foreign key to "company" to identify the "courses" for that company.
If a employee logs successfully, it will be listed all the courses for the company which he belongs to.
So how could i make the application?
I must have a login system. If the login is sucessfull, i will register the company id has a session variable? And in every action in any controller i will have to check always if the ID is correct to change some information?

Or there is other solution to design this example?
For example, Blinksale's clients log to the address: "CLIENT_NAME.blinksale.com" and work in that address - is this another solution? How to accomplish?
Other applications use something like: admin/2200/create/... and 2200 is the number of an ID of a table...

I'm a bit confused... i read the example in the Rails book about the shopping application but the design of the application seemed very simple... there are any example more sophisticated?

Thanks