allow tags to be added when creating a channel

This commit is contained in:
Lee Lawlor 2014-03-27 15:15:54 -04:00
parent afdfca9fab
commit 6d48aaa8fc
3 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,7 @@ class ChannelsController < ApplicationController
channel.set_windows
channel.save
channel.save_tags(params[:channel][:tags]) if params[:channel][:tags].present?
channel.add_write_api_key
@channel_id = channel.id
respond_to do |format|

View File

@ -54,10 +54,11 @@ class Channel < ActiveRecord::Base
has_many :feeds
has_many :daily_feeds
has_many :api_keys, :dependent => :destroy
has_many :taggings
has_many :taggings, :dependent => :destroy
has_many :tags, :through => :taggings
has_many :comments, :dependent => :destroy
has_many :windows, :dependent => :destroy, :autosave => true
accepts_nested_attributes_for :tags
self.include_root_in_json = true

View File

@ -24,6 +24,7 @@ Valid parameters:
<li><b>longitude</b> (decimal) - Longitude in degrees (optional)</li>
<li><b>name</b> (string) - Name of the Channel (optional)</li>
<li><b>public_flag</b> (true/false) - Whether the Channel should be public, default false (optional)</li>
<li><b>tags</b> (string) - Comma-separated list of tags (optional)</li>
<li><b>url</b> (string) - Webpage URL for the Channel (optional)</li>
</ul>