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

@ -22,10 +22,10 @@ class Panel::Dictionary::BackEnd::DictionaryVocabsController < OrbitBackendContr
format.xml { render :xml => @vocab } format.xml { render :xml => @vocab }
end end
end end
def new def new
@vocab = DictionaryVocab.new @vocab = DictionaryVocab.new
# @categories = get_categories_for_index("MarketItemCategory") @categories = get_categories_for_index("DictionaryVocabCategory")
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@ -37,7 +37,7 @@ class Panel::Dictionary::BackEnd::DictionaryVocabsController < OrbitBackendContr
@vocab = DictionaryVocab.new(params[:dictionary_vocab]) @vocab = DictionaryVocab.new(params[:dictionary_vocab])
@vocab.create_user_id = current_user.id @vocab.create_user_id = current_user.id
@vocab.update_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 if @vocab.save
flash[:success] = "Success!" flash[:success] = "Success!"

View File

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

View File

@ -1,15 +1,15 @@
<br /> <br />
<div class="offset1"> <div class="offset1">
<h4><%= t :category, :scope => :dictionary %></h4> <h4><%= t :category, :scope => :dictionary %></h4>
<%= f.collection_select :dictionary_vocab_category_id, @categories, :id, :title %> <%= f.collection_select :dictionary_vocab_category_id, @categories, :id, :title %>
</div> </div>
<div class="offset1"> <div class="offset1">
<h4><%= t :word, :scope => :dictionary %></h4> <h4><%= t :word, :scope => :dictionary %></h4>
<%= f.text_field :title %> <%= f.text_field :word %>
</div> </div>
<div class="offset1"> <div class="offset1">
<h4><%= t :definition, :scope => :dictionary %></h4> <h4><%= t :definition, :scope => :dictionary %></h4>
<%= f.text_area :price %> <%= f.text_area :definition %>
</div> </div>
<br /> <br />
<div class="offset1"> <div class="offset1">