I'm working on an angular form that is used to create an object with tags:
<form class="form-horizontal" ng-submit="createBeacon(beaconData)">
<div class="form-group">
<label>Tags</label>
<div id="tags-list" data-current-user-company="{{current_user.company_id}}">
<input type="text" id="tags-input" class="form-control" ng-model="beaconData.tag_list" name="beacon[tag_list]" placeholder="project, client 72, yellow, design"/>
</div>
</div>
This form sends the data to a rails controller using a factory to save it in the database. Here's the function responsible for submitting the data:
$scope.createBeacon = function(beacon){
Beacon.save({
alias: beacon.alias,
description: beacon.description,
status: beacon.status,
company_id: currentUser.company_id,
venue_id: beacon.venue_id,
beacon_id: beacon.beacon_id,
tag_list: beacon.tag_list
});
}
The issue I'm facing is that even though the tag_list parameter is being sent to Rails, it's not getting committed into the tags and taggings tables as it should when submitted through a Rails form.
https://i.sstatic.net/Q5Gwl.png
Any suggestions or advice on how to tackle this problem?