I am very new to ember so this may be something that is really simple but all my research has gotten me nowhere. I appreciate the help
I have a very simple app I am trying to practice with. There is a form in my ember front-end where you can create users with a name and a birthdate. On submit I want the data to go to my rails backend and create the user. The data in the name field is posting to the route but the date field is coming back as null. Here is my code
The form
<form {{action "save" on="submit"}}>
<p>
<label>Name:
{{input value=model.name}}
</label>
</p>
<p>
<label>Date of Birth:
{{input value=model.dob}}
</label>
</p>
<input type="submit" value="Save"/>
</form>
The Controller
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
this.get('model').save()
return false;
}
}
});
Parameters from the users#create route in rails
Parameters: {"user"=>{"name"=>"testname", "dob"=>nil}}
edit: Model defenition
import DS from 'ember-data';
export default DS.Model.extend({
name: DS.attr('string'),
dob: DS.attr('date')
});
Thank you for any help