This commit is contained in:
huang 2018-02-07 17:25:41 +08:00
parent 65e2433592
commit ae0e78664c
1 changed files with 3 additions and 4 deletions

View File

@ -19,7 +19,7 @@
<div class="field line_field">
<label><span>*</span>数据分类:</label>
<%= f.select :main_category_id, (@main_categories.collect { |mc| [mc.name, mc.id] }),
{:no_label => true}, :onchange => "get_sub_category(this.options[this.options.selectedIndex].value)",
{:no_label => true}, :onchange => 'getSubCategory(this.options[this.options.selectedIndex].value)',
:class => "w150" %>
<%#= f.text_field :description %>
<!--<div class="fl pr wb20 change_sort">-->
@ -68,10 +68,9 @@
<script>
// 获取子类别
function get_sub_category(id) {
alert(id);
function getSubCategory(id){
$.ajax({
url: <%= get_sub_category_statistics_path %>,
url: '<%= get_sub_category_statistics_path %>',
type: 'get',
data: {main_category_id: id}
});