Refactor javascript to coffee

This commit is contained in:
Martin Lensment 2015-01-30 12:07:47 +02:00
parent 65d849cc36
commit 8275123037
4 changed files with 9 additions and 14 deletions

View file

@ -36,5 +36,5 @@
.col-md-12.text-right
= button_tag(t('save'), class: 'btn btn-primary')
:javascript
:coffee
Autocomplete.bindAdminRegistrarSearch();

View file

@ -16,7 +16,6 @@
.col-md-12.text-right
= button_tag(t('save'), class: 'btn btn-primary')
:javascript
$(function() {
$('#tabs a:first').tab('show')
})
:coffee
$ ->
$("#tabs a:first").tab "show"

View file

@ -19,10 +19,8 @@
= status_fields.label :description, class: 'col-md-2 control-label'
.col-md-10
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
:javascript
$("#domain-statuses").nestedAttributes({
bindAddTo: $(".add-domain-status"),
afterAdd: function(item) {
item.find('.errors').html('');
}
});
:coffee
$("#domain-statuses").nestedAttributes
bindAddTo: $(".add-domain-status")
afterAdd: (item) ->
item.find(".errors").html ""

View file

@ -30,7 +30,5 @@ describe Registrar do
@registrar.errors[:email].should == ['is invalid']
@registrar.errors[:billing_email].should == ['is invalid']
end
end
end