It's all because CI expects URL's to have at least 2 segments: controller and method. If the second segment is omitted, the controller will execute the index method by default.
Code:
c_tunesheet/edit //means: open then c_tunesheet controller and find the edit method inside it
c_tunesheet/edit/44 //means: find the edit method (like the first example) and pass the value 44 to the first parameter
c_tunesheet //means: open the c_tunesheet controller and find the index method
The command
Code:
window.open("<?= site_url('c_tunesheet/');?>"+tuneID,'_blank');
will assume that tuneID is the name of the method!
This should work:
Code:
window.open("<?= site_url('c_tunesheet/index');?>"+tuneID,'_blank');
But then, your index method should look like this:
PHP Code:
public function index($tuneID = NULL) {
//your code here
}
to pass the parameter!
= NULL means that the variable $tuneID will be set to NULL if no parameter is passed.