rails

http://blog.csdn.net/lissdy/article/details/9195651

<%=select_tag('site_id',options_for_select(@sites.collect{|s|[s.name,s.id]}.insert(0,["所有",0])))%>

<%=select_tag('server_room_id',options_from_collection_for_select(ServerRoom.find_all_have_site_server_rooms,:id,:room))%>

<%=select('site','id',Site.find(:all).collect{|s|[s.name,s.id]}.insert(0,["所有",0]))%>这种在controller处理时格式params[:site][:id]

<%=select('site','isp_id',Isp.find(:all).collect{|i|[i.name,i.id]},{:selected=>@site.isp_id})%>选中

http://blog.csdn.net/shushm/article/details/8567701

http://fsjoy.blog.51cto.com/318484/141760

https://ruby-china.org/topics/22536

http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html

http://stackoverflow.com/questions/20117959/accepts-nested-attributes-for-rails-4-is-not-deleting

http://railscasts.com/episodes/196-nested-model-form-part-1

http://stackoverflow.com/questions/15919761/rails-4-nested-attributes-unpermitted-parameters

http://stackoverflow.com/questions/23373668/rails-4-nested-attributes-with-fields-for-dont-save-to-database

sudoapt-getinstallsqlite3

sudoapt-getinstallruby1.8-devlibsqlite3-dev

sudogeminstallsqlite3-ruby

http://blog.csdn.net/meteorlwj/article/details/5554965

相关推荐