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?