mardi 17 février 2015

Uncaught Error: Nothing handled the action 'edit' - Correct controller name to put the action

First of all,I am new to ember.I have a "show" handlebar inside "templates/orders/show.hbs" . The form submit action in this handlebar always returning "Uncaught Error: Nothing handled the action 'edit'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble." . I have the edit action defined in controllers/orders.js. Am i placing the edit action in wrong file. If so, what would be the correct place to have the "edit" action.


This is my handlebar:



<form class="form-horizontal" {{action "edit" this on="submit"}}>
<div class="control-group">
<div class="control-label">
<label>Name</label>
</div>

<div class="controls">
{{input value=name type="text"}}
</div>
</div>

<div class="control-group">
<div class="control-label">
<label>Age</label>
</div>

<div class="controls">
{{input value=fury type="text"}}
</div>
</div>
<button type="submit" class="btn">submit</button>
</form>


This is my controller file: export default Ember.ObjectController.extend({ actions: { edit: function(){ console.log('EDIT - Entered'); } } });


Thanks!





Aucun commentaire:

Enregistrer un commentaire