Guest User

Untitled

a guest
Apr 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.21 KB | None | 0 0
  1. # schema for model
  2. create_table "price_lists", :force => true do |t|
  3. t.integer "user_id"
  4. t.string "name"
  5. t.timestamps
  6. end
  7.  
  8.  
  9. # controller
  10. def edit
  11. @price_lists = PriceList.find_by_user_id(current_user.id)
  12. @gallery = Gallery.find(params[:id])
  13. end
  14.  
  15.  
  16. # view
  17. %li
  18. %label Price List
  19. = f.collection_select :price_list_id, @price_lists, :id, :name
  20.  
  21.  
  22. # error
  23. undefined method `map' for #<PriceList:0x219f9f4
  24.  
  25. /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in `method_missing'
  26. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_options_helper.rb:180:in `options_from_collection_for_select'
  27. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_options_helper.rb:366:in `to_collection_select_tag'
  28. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_options_helper.rb:118:in `collection_select'
  29. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_options_helper.rb:413:in `collection_select'
  30. app/views/admin/galleries/_fields.haml:10:in `_run_template_47app47views47admin47galleries47_fields46haml'
  31. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `send'
  32. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template'
  33. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template'
  34. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file'
  35. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:331:in `render_without_haml'
  36. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:7:in `render'
  37. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/partials.rb:117:in `render_partial'
  38. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:26:in `benchmark'
  39. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:26:in `benchmark'
  40. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/partials.rb:116:in `render_partial'
  41. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:352:in `render_without_haml'
  42. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:7:in `render'
  43. app/views/admin/galleries/edit.haml:6:in `_run_template_47app47views47admin47galleries47edit46haml'
  44. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:72:in `call'
  45. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:72:in `form_for'
  46. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers.rb:336:in `call'
  47. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers.rb:336:in `haml_bind_proc'
  48. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_helper.rb:248:in `fields_for'
  49. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_helper.rb:184:in `form_for_without_haml'
  50. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:76:in `form_for'
  51. app/views/admin/galleries/edit.haml:5:in `_run_template_47app47views47admin47galleries47edit46haml'
  52. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers.rb:344:in `call'
  53. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers.rb:344:in `capture_haml_with_buffer'
  54. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/haml/helpers/action_view_mods.rb:22:in `capture_erb_with_buffer'
  55. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/capture_helper.rb:44:in `capture'
  56. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/capture_helper.rb:126:in `content_for'
  57. app/views/admin/galleries/edit.haml:1:in `_run_template_47app47views47admin47galleries47edit46haml'
  58. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `send'
  59. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template'
  60. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template'
  61. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file'
  62. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file'
  63. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout'
  64. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:262:in `render_without_benchmark'
  65. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render'
  66. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render'
  67. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render'
  68. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters'
  69. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
  70. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
  71. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  72. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  73. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
  74. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
  75. /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
  76. /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
  77. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
  78. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
  79. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
  80. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
  81. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process'
  82. /Library/Ruby/Gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process'
  83. /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
  84. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
  85. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
  86. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
  87. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
  88. /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64
  89. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  90. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
  91. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  92. /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
Add Comment
Please, Sign In to add comment