rails
程序员文章站
2022-07-12 09:22:24
...
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://*.com/questions/20117959/accepts-nested-attributes-for-rails-4-is-not-deleting
http://railscasts.com/episodes/196-nested-model-form-part-1
http://*.com/questions/15919761/rails-4-nested-attributes-unpermitted-parameters
http://*.com/questions/23373668/rails-4-nested-attributes-with-fields-for-dont-save-to-database
sudo apt-get install sqlite3
sudo apt-get install ruby1.8-dev libsqlite3-dev
sudo gem install sqlite3-ruby
http://blog.csdn.net/meteorlwj/article/details/5554965
<%=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://*.com/questions/20117959/accepts-nested-attributes-for-rails-4-is-not-deleting
http://railscasts.com/episodes/196-nested-model-form-part-1
http://*.com/questions/15919761/rails-4-nested-attributes-unpermitted-parameters
http://*.com/questions/23373668/rails-4-nested-attributes-with-fields-for-dont-save-to-database
sudo apt-get install sqlite3
sudo apt-get install ruby1.8-dev libsqlite3-dev
sudo gem install sqlite3-ruby
http://blog.csdn.net/meteorlwj/article/details/5554965