add collection select to dic categories

This commit is contained in:
thomaschen 2013-08-22 16:33:46 +08:00 committed by chris
parent 3f87914e46
commit 6e2725d279
3 changed files with 10 additions and 10 deletions

View File

@ -25,7 +25,7 @@ class Panel::Dictionary::BackEnd::DictionaryVocabsController < OrbitBackendContr
def new
@vocab = DictionaryVocab.new
# @categories = get_categories_for_index("MarketItemCategory")
@categories = get_categories_for_index("DictionaryVocabCategory")
respond_to do |format|
format.html # new.html.erb
@ -37,7 +37,7 @@ class Panel::Dictionary::BackEnd::DictionaryVocabsController < OrbitBackendContr
@vocab = DictionaryVocab.new(params[:dictionary_vocab])
@vocab.create_user_id = current_user.id
@vocab.update_user_id = current_user.id
# @categories = get_categories_for_index("MarketItemCategory")
@categories = get_categories_for_index("DictionaryVocabCategory")
if @vocab.save
flash[:success] = "Success!"

View File

@ -5,8 +5,8 @@ class DictionaryVocab
include Mongoid::MultiParameterAttributes
include Mongoid::Sortable
# BelongsToCategory = :archive_file_category
# include OrbitCoreLib::BelongsToCategoryMayDisable
BelongsToCategory = :dictionary_vocab_category
include OrbitCoreLib::BelongsToCategoryMayDisable
# PAYMENT_TYPES = @site_valid_locales

View File

@ -5,11 +5,11 @@
</div>
<div class="offset1">
<h4><%= t :word, :scope => :dictionary %></h4>
<%= f.text_field :title %>
<%= f.text_field :word %>
</div>
<div class="offset1">
<h4><%= t :definition, :scope => :dictionary %></h4>
<%= f.text_area :price %>
<%= f.text_area :definition %>
</div>
<br />
<div class="offset1">