Skip to content

Instantly share code, notes, and snippets.

@voondo
Created December 10, 2012 17:32
Show Gist options
  • Save voondo/4252020 to your computer and use it in GitHub Desktop.
Save voondo/4252020 to your computer and use it in GitHub Desktop.
<%= simple_form_for [parent, resource], html: {class: "form-horizontal"} do |f| %>
[...]
<%= f.simple_fields_for :master do |p| %>
<%= p.input :price, as: :currency %>
<%= p.input :description, input_html: {style: "height: 8em"} %>
<% end %>
#The error
NoMethodError in Suppliers::Products::ProductsController#create
undefined method `master' for nil:NilClass
Rails.root: /var/home/romain/pro/mlb
Application Trace | Framework Trace | Full Trace
vendor/gems/spree/core/app/models/spree/variant.rb:177:in `check_price'
activesupport (3.2.9) lib/active_support/callbacks.rb:440:in `_run__4446491219441658265__validate__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activemodel (3.2.9) lib/active_model/validations.rb:228:in `run_validations!'
activemodel (3.2.9) lib/active_model/validations/callbacks.rb:53:in `block in run_validations!'
activesupport (3.2.9) lib/active_support/callbacks.rb:403:in `_run__4446491219441658265__validation__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activemodel (3.2.9) lib/active_model/validations/callbacks.rb:53:in `run_validations!'
activemodel (3.2.9) lib/active_model/validations.rb:195:in `valid?'
activerecord (3.2.9) lib/active_record/validations.rb:69:in `valid?'
activerecord (3.2.9) lib/active_record/autosave_association.rb:300:in `association_valid?'
activerecord (3.2.9) lib/active_record/autosave_association.rb:280:in `validate_single_association'
activerecord (3.2.9) lib/active_record/autosave_association.rb:217:in `block in add_autosave_association_callbacks'
activerecord (3.2.9) lib/active_record/autosave_association.rb:161:in `instance_eval'
activerecord (3.2.9) lib/active_record/autosave_association.rb:161:in `block in define_non_cyclic_method'
activesupport (3.2.9) lib/active_support/callbacks.rb:528:in `_run__2036074271653508830__validate__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activemodel (3.2.9) lib/active_model/validations.rb:228:in `run_validations!'
activemodel (3.2.9) lib/active_model/validations/callbacks.rb:53:in `block in run_validations!'
activesupport (3.2.9) lib/active_support/callbacks.rb:414:in `_run__2036074271653508830__validation__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activemodel (3.2.9) lib/active_model/validations/callbacks.rb:53:in `run_validations!'
activemodel (3.2.9) lib/active_model/validations.rb:195:in `valid?'
activerecord (3.2.9) lib/active_record/validations.rb:69:in `valid?'
activerecord (3.2.9) lib/active_record/validations.rb:77:in `perform_validations'
activerecord (3.2.9) lib/active_record/validations.rb:50:in `save'
activerecord (3.2.9) lib/active_record/attribute_methods/dirty.rb:22:in `save'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
activerecord (3.2.9) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block in save'
activerecord (3.2.9) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
activerecord (3.2.9) lib/active_record/transactions.rb:258:in `save'
activerecord (3.2.9) lib/active_record/autosave_association.rb:415:in `save_belongs_to_association'
activerecord (3.2.9) lib/active_record/autosave_association.rb:209:in `block in add_autosave_association_callbacks'
activerecord (3.2.9) lib/active_record/autosave_association.rb:161:in `instance_eval'
activerecord (3.2.9) lib/active_record/autosave_association.rb:161:in `block in define_non_cyclic_method'
activesupport (3.2.9) lib/active_support/callbacks.rb:407:in `_run__4446491219441658265__save__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.9) lib/active_record/callbacks.rb:264:in `create_or_update'
activerecord (3.2.9) lib/active_record/persistence.rb:84:in `save'
activerecord (3.2.9) lib/active_record/validations.rb:50:in `save'
activerecord (3.2.9) lib/active_record/attribute_methods/dirty.rb:22:in `save'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
activerecord (3.2.9) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block in save'
activerecord (3.2.9) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
activerecord (3.2.9) lib/active_record/transactions.rb:258:in `save'
activerecord (3.2.9) lib/active_record/autosave_association.rb:395:in `save_has_one_association'
activerecord (3.2.9) lib/active_record/autosave_association.rb:197:in `block in add_autosave_association_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:433:in `_run__2036074271653508830__create__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.9) lib/active_record/callbacks.rb:268:in `create'
activerecord (3.2.9) lib/active_record/persistence.rb:348:in `create_or_update'
activerecord (3.2.9) lib/active_record/callbacks.rb:264:in `block in create_or_update'
activesupport (3.2.9) lib/active_support/callbacks.rb:469:in `_run__2036074271653508830__save__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.9) lib/active_record/callbacks.rb:264:in `create_or_update'
activerecord (3.2.9) lib/active_record/persistence.rb:84:in `save'
activerecord (3.2.9) lib/active_record/validations.rb:50:in `save'
activerecord (3.2.9) lib/active_record/attribute_methods/dirty.rb:22:in `save'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
activerecord (3.2.9) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.9) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block in save'
activerecord (3.2.9) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
activerecord (3.2.9) lib/active_record/transactions.rb:258:in `save'
vendor/gems/inherited_resources/lib/inherited_resources/base_helpers.rb:66:in `create_resource'
vendor/gems/inherited_resources/lib/inherited_resources/actions.rb:33:in `create'
actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.9) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.9) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.9) lib/active_support/callbacks.rb:414:in `_run__2278093883915608499__process_action__2813393234027973305__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.9) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.9) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.9) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `_run__1695604371179494277__call__290839613725006380__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.9) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `call'
quiet_assets (1.0.1) lib/quiet_assets.rb:20:in `call_with_quiet_assets'
actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.9) lib/rails/engine.rb:479:in `call'
railties (3.2.9) lib/rails/application.rb:223:in `call'
railties (3.2.9) lib/rails/railtie/configurable.rb:30:in `method_missing'
thin (1.5.0) lib/thin/connection.rb:81:in `block in pre_process'
thin (1.5.0) lib/thin/connection.rb:79:in `catch'
thin (1.5.0) lib/thin/connection.rb:79:in `pre_process'
thin (1.5.0) lib/thin/connection.rb:54:in `process'
thin (1.5.0) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run'
thin (1.5.0) lib/thin/backends/base.rb:63:in `start'
thin (1.5.0) lib/thin/server.rb:159:in `start'
thin (1.5.0) lib/thin/controllers/controller.rb:86:in `start'
thin (1.5.0) lib/thin/runner.rb:187:in `run_command'
thin (1.5.0) lib/thin/runner.rb:152:in `run!'
thin (1.5.0) bin/thin:6:in `<top (required)>'
bin/thin:16:in `load'
bin/thin:16:in `<main>'
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"jZYYDNe10Iht4R612EBCMYcGlWs6xawk0sRuzZ86tKI=",
"product"=>{"name"=>"T-Shirt TroBien",
"supplier_code"=>"",
"taxon_id"=>"2",
"availability"=>"Lorem",
"standard"=>"None",
"gender_required"=>"Any",
"experience_required"=>"Lorem",
"exclusivity"=>"None",
"localization_required"=>"France métropolitaine",
"sales_pitch"=>"dsdfsdf",
"master_attributes"=>{"price"=>"400",
"description"=>"sdfsdfqsdf"}},
"commit"=>"Créer un(e) Produit",
"locale"=>"fr",
"supplier_id"=>"1"}
Show session dump
Show env dump
Response
Headers:
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment