inserting a form on a page when button pressed

the easiest way to add a form onClick is to include it in the original view. just use a div to wrap it and set its height to 0px and overflow to hide. now onClick of your button you could call a javascript to reset height. you could even add a nice morph-effect or something like it.

of course you could do the same with an AJAX-call to update the html of a formerly empty div. your attempt to use remote_link_to seems promising, too.

to which action in which controller you link is your decision and depends on the structure of your app.

unfortunately i can't understand your last problem:

IF on the same page i had varius links of this sort such as "add task", "expand table", "collapse table" and they all linked back to the same controller action, how would i diferentiate between them. Would the logic be in the controller opening up different rjs files or would it be in teh one rjs file?

different links to the same action? if they should do the same, why label them differently? if not, why use the same action. you could just add an action called "add_task", another called "expand_table" and so on...

hope i could help you anyway.