 
     on_activate_click: (event) =>
         env = @envs.get_active()
-        $.ajax({url: "/api/env/#{env.get('name')}/activate", type: 'POST'})
+        api("env/#{env.get('name')}/activate", {}, @on_env_activate)
 
     on_delete_click: (event) =>
         new DeleteEnvView(envs: @envs).show()


    on_submit: (event) =>
        env = @envs.get_active()
        $.ajax({url: "/api/env/#{env.get('name')}/delete", type: 'POST'})
        @hide()

class EnvModalView extends ModalView


    submit_text: () -> "Clone"

    doit: (new_name) ->
        api("env/#{@envs.get_active()}/clone/#{new_name}", {}, @on_env_clone)

    on_env_clone: (data) =>
        # TODO

class NewEnvView extends EnvModalView

