fixed the metacode editing. TODO: Description, Link

This commit is contained in:
Devin Howard 2013-01-02 20:46:01 -05:00
parent c62f99d0fb
commit 84c8494f2b
2 changed files with 2 additions and 6 deletions

View file

@ -564,9 +564,7 @@ function onCreateLabelHandler(domElement, node) {
var metacode_choices = "'[";
for (var key in imgArray) {
if (imgArray.hasOwnProperty(key)) {
var caps = key;
var nocaps = caps.toLowerCase();
metacode_choices += '["' + nocaps + '","' + caps + '"],';
metacode_choices += '["' + key + '","' + key + '"],';
}
}
//remove trailing comma and add ]

View file

@ -129,9 +129,7 @@ class TopicsController < ApplicationController
@topic.desc = params[:topic][:desc] if params[:topic][:desc]
@topic.link = params[:topic][:link] if params[:topic][:link]
@topic.permission = params[:topic][:permission] if params[:topic][:permission]
end
if params[:category]
@topic.metacode = Metacode.find(params[:category][:metacode_id]) if params[:category][:metacode_id]
@topic.metacode = Metacode.find_by_name(params[:topic][:metacode]) if params[:topic][:metacode]
end
@topic.save
end