This commit is contained in:
Renzo 2016-08-14 14:52:08 -05:00
parent 48b182b2f6
commit b009bb77ad
2 changed files with 24 additions and 12 deletions

View File

@ -110,4 +110,16 @@ class TagSubscription extends Rails\ActiveRecord\Base
}
}
}
protected function validations()
{
return [
'name' => [
'length' => ['minimum' => 1]
],
'tag_query' => [
'length' => ['minimum' => 1]
],
];
}
}

View File

@ -1,7 +1,7 @@
<tr id="tag-subscription-row-<?= $this->tag_subscription->id ?>">
<td><input onclick="new Ajax.Request('<?= $this->urlFor(['tag_subscription#destroy', 'id' => $this->tag_subscription->id, 'format' => 'js']) ?>', {asynchronous:true, evalScripts:true});" type="button" value="<?= '-' ?>"></td>
<td><?= $this->textFieldTag("tag_subscription[".$this->tag_subscription->id."][name]", $this->tag_subscription->name, ['size' => 20]) ?></td>
<td><?= $this->textFieldTag("tag_subscription[".$this->tag_subscription->id."][tag_query]", $this->tag_subscription->tag_query, ['size' => 70]) ?></td>
<td><?= $this->textFieldTag("tag_subscription[".$this->tag_subscription->id."][name]", $this->tag_subscription->name, ['size' => 20, 'required']) ?></td>
<td><?= $this->textFieldTag("tag_subscription[".$this->tag_subscription->id."][tag_query]", $this->tag_subscription->tag_query, ['size' => 70, 'required']) ?></td>
<td>
<?= $this->selectTag("tag_subscription[".$this->tag_subscription->id."][is_visible_on_profile]", $this->optionsForSelect(["Visible" => 1, "Hidden" => 0], $this->tag_subscription->is_visible_on_profile)) ?>
</td>