rss2_id added and some changes in form

This commit is contained in:
Harry Bomrah 2014-07-14 21:30:11 +08:00
parent 22fa13b0a5
commit 60fbc344d1
3 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ class Patent
include OrbitModel::Status
include Slug
belongs_to :patent_type
has_and_belongs_to_many :patent_types
belongs_to :member_profile
field :patent_title, as: :slug_title, localize: true
@ -18,6 +18,7 @@ class Patent
field :publish_date , :type => Date
field :url
field :note
field :rss2_id
field :create_user_id, :type => BSON::ObjectId
field :update_user_id, :type => BSON::ObjectId

View File

@ -4,6 +4,6 @@ class PatentType
field :title, localize: true
has_many :patents
has_and_belongs_to_many :patents
end

View File

@ -53,7 +53,9 @@
<div class="control-group">
<label class="control-label muted"><%= t("personal_patent.patent_category") %></label>
<div class="controls">
<%= f.select :patent_type_id, @patent_types.collect {|t| [ t.title, t.id ]} %>
<% @patent_types.each do |pt| %>
<input type="checkbox" name="patent[patent_type_ids][]" value="<%= pt.id.to_s %>" <%= (@patent.patent_type_ids.include?pt.id) ? "checked=checked" : "" %> /> <%= pt.title %>
<% end %>
</div>
</div>