Fix category_id in forms

Fix statuses list
This commit is contained in:
chris 2013-07-16 11:41:22 +08:00
parent 1c4b66f1cb
commit 62288a71ca
3 changed files with 11 additions and 5 deletions

View File

@ -21,9 +21,11 @@ class OrbitBackendController < ApplicationController
status << 'is_top' status << 'is_top'
status << 'is_hot' status << 'is_hot'
status << 'is_hidden' unless is_guest? status << 'is_hidden' unless is_guest?
status << 'is_pending' if is_manager? if @module_app.is_approvable && is_manager?
status << 'is_checked' if is_manager? status << 'is_pending'
status << 'is_rejected' if is_manager? status << 'is_checked'
status << 'is_rejected'
end
status status
end end

View File

@ -31,7 +31,11 @@ module OrbitCategory
def category=(id) def category=(id)
self.buffer_category.destroy if self.buffer_category self.buffer_category.destroy if self.buffer_category
self.build_buffer_category(category_id: id) self.build_buffer_category(category_id: id)
self.category_id = id self.write_attribute(:category_id, id)
end
def category_id=(id)
category = id
end end
def disable? def disable?

View File

@ -51,7 +51,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t(:category) %></label> <label class="control-label muted"><%= t(:category) %></label>
<div class="controls"> <div class="controls">
<%= f.select :category, @categories.collect{|t| [ t.title, t.id ]} %> <%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
</div> </div>
</div> </div>