Topic: I'm confused by REST!
I'm trying to understand how best to implement REST and keep to REST principles within my application. I can certainly see how REST is useful for simple parent children relationships and how the idea of resources can ensure your database is useful when accessed via a number of methods html/xml etc.
However I'm trying to figure how it helps simplify more complicated database associations.
For instance, I am coding a rails application that has a "report" resource upon which the relationship between "tasks" and "operatives" are recorded on a daily basis.
report <--many to many --> operatives
report <-many to many --> tasks
tasks <-many to many --> operatives
Setting up the models is fine (has_many :through is great) and it works however I'm confused when I come to work with editing these relationships.
The idea is each report can be edited as its own resource and tasks/operatives/assignments edited and created on that page.
However this necesitates creation and destruction of other model records from the report's edit form. Surely this breaks the REST principle, i'm no longer calling resource CRUD methods but rather using the ReportController's edit method to effectively RPC and manhandle my records.
Now I'm at a stage where I need to create new "task" records based on entries in the report form and handled by the report controller. (and obviously in turn the taskassignments which relates those tasks to operatives).
Ultimately I would like Ajax to handle the addition of new tasks and dynamically update the form surely this would require calling of methods outside of the resources standard CRUD methods again is this against REST or have I got myself confused?
Sorry for the rambling I know I can hack together a solution but I dont want to get into bad habits and make a bad design choice for my application which I would regret later.
Thanks for the help!