Reputation: 57
I have this button in my view page
<a class="runimg" href="${createLink(controller: 'Ec2Controller', action: 'Start', id: i.Id)}"> Start </a>
It is suppose to take the id of the instance and then pass it to my action in the controller. However it is looking for the Start view page rather than executing my action in the Ec2Controller. Any suggestion?
My controller has this
def Start() {
amazonWebService.ec2.startInstances(new StartInstancesRequest([InstanceToStart]))
redirect action: index()
}
Upvotes: 1
Views: 107
Reputation: 12238
In addition to what @Sérgio said, unless your controller is named Ec2ControllerController
, your controller name is wrong. It should just be Ec2
.
Upvotes: 1
Reputation:
You called a method index in your redirect:
redirect action: index()
It should be
redirect action: 'index'
Upvotes: 0