尊敬的脂肪酶的Rails ...过滤数据库导致的Ruby on使用下拉
我真的有栏杆,所以我需要你的宝贵帮助新...
我在我的DB数据库视图称为“graph_hospital_vacant_by_band “
mysql> desc graph_hospital_vacant_by_band;
+-------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| specialisation_id | int(11) | NO | | NULL | |
| specialisation | varchar(255) | YES | | NULL | |
| nos | bigint(21) | NO | | 0 | |
| hospitalband | varchar(255) | NO | | NULL | |
+-------------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
其模型是:
class GraphHospitalVacantByBand < ActiveRecord::Base
self.table_name = 'graph_hospital_vacant_by_band'
end
和控制器是一个小号如下:
class GraphHospitalVacantByBandsController < InheritedResources::Base
end
而且视图如下:
<table class="table table-bordered">
<thead>
<tr>
<th>Specialisation</th>
<th>No.</th>
<th>Hospital Band</th>
</tr>
</thead>
<tbody>
<% @graph_hospital_vacant_by_bands.each do |graph_hospital_vacant_by_band| %>
<tr>
<td><%= graph_hospital_vacant_by_band.specialisation %></td>
<td><%= graph_hospital_vacant_by_band.nos %></td>
<td><%= graph_hospital_vacant_by_band.hospitalband %></td>
</tr>
<% end %>
</tbody>
</table>
目前示出了本
http://i.stack.imgur.com/v7Jwt.png
我需要与上面所述availaible特下拉,使得在选择所述特殊专业nos,该专业的医院带显示...
我环顾四周,并尝试了很多,但白白....
林没有得到我应该如何更新我的模型,和控制器来处理传递的参数....
感谢名单非常...
诚挚的问候 -sky
请帮助脂肪酶... – SkyKOG 2013-03-14 17:05:59