Skip to content

Commit

Permalink
Use quoted action names.
Browse files Browse the repository at this point in the history
Actions can now use bound property lookup (instead of being static
strings).

This was added in emberjs/ember.js#3936.
  • Loading branch information
rwjblue committed Jan 27, 2014
1 parent 8d2c984 commit 30eed33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Update to Ember Data 1.0.0-beta.6 to resolve adapter/serializer resolution issues.
* Scaffold, put `input` inside `label` instead of having an empty `for` (#a85bde2).
* Scaffold, add default classes to templates.
* Scaffold: use quoted action names (prepare for bound action lookup added [here](https://github.com/emberjs/ember.js/pull/3936)).

## 0.4.0

Expand Down
4 changes: 2 additions & 2 deletions lib/generators/templates/scaffold/template/form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
</div>
<% end -%>

<button type="submit" {{action save this}}>Save</button>
<button type="submit" {{action cancel this}}>Cancel</button>
<button type="submit" {{action 'save' this}}>Save</button>
<button type="submit" {{action 'cancel' this}}>Cancel</button>
2 changes: 1 addition & 1 deletion lib/generators/templates/scaffold/template/show.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3>{{id}}</h3>

<p>{{link-to 'Edit' '<%= file_name.pluralize -%>.edit' this}} <button {{action destroyRecord this}}>Destroy</button></p>
<p>{{link-to 'Edit' '<%= file_name.pluralize -%>.edit' this}} <button {{action 'destroyRecord' this}}>Destroy</button></p>

<ul>
<% attributes.each do |attribute| -%>
Expand Down

0 comments on commit 30eed33

Please sign in to comment.