Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:06:37+00:00 2026-06-05T09:06:37+00:00

Im getting an association error (using simpleform) but i believe my models to be

  • 0

Im getting an association error (using simpleform) but i believe my models to be setup appropriately.. see below.. Thanks!

   ArgumentError in User_steps#show

Showing /Users/nelsonkeating/Desktop/ReminDeal/app/views/user_steps/occasions.html.erb where line #17 raised:

Association cannot be used in forms not associated with an object
Extracted source (around line #17):

14:     
15:     <h3>Related Interest</h3>
16: 
17:     <li><%= occasion_o.association :interests, :label => false, :as => :check_boxes %></li>
18:     
19:    
20: 
Rails.root: /Users/nelsonkeating/Desktop/ReminDeal

Application Trace | Framework Trace | Full Trace
simple_form (2.0.2) lib/simple_form/form_builder.rb:171:in `association'
app/views/user_steps/occasions.html.erb:17:in `block (2 levels) in _app_views_user_steps_occasions_html_erb___2581036131298452069_70258891699320'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
haml (3.1.6) lib/haml/helpers/xss_mods.rb:109:in `with_output_buffer_with_haml_xss'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (3.1.6) lib/haml/helpers/action_view_mods.rb:105:in `capture_with_haml'
actionpack (3.2.3) lib/action_view/helpers/form_helper.rb:606:in `fields_for'
client_side_validations (3.1.4) lib/client_side_validations/action_view/form_helper.rb:45:in `fields_for'
actionpack (3.2.3) lib/action_view/helpers/form_helper.rb:1310:in `fields_for'
client_side_validations (3.1.4) lib/client_side_validations/action_view/form_builder.rb:45:in `fields_for_with_client_side_validations'
simple_form (2.0.2) lib/simple_form/action_view_extensions/builder.rb:204:in `simple_fields_for'
app/views/user_steps/occasions.html.erb:9:in `block in _app_views_user_steps_occasions_html_erb___2581036131298452069_70258891699320'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
haml (3.1.6) lib/haml/helpers/xss_mods.rb:109:in `with_output_buffer_with_haml_xss'
actionpack (3.2.3) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (3.1.6) lib/haml/helpers/action_view_mods.rb:105:in `capture_with_haml'
actionpack (3.2.3) lib/action_view/helpers/form_helper.rb:606:in `fields_for'
client_side_validations (3.1.4) lib/client_side_validations/action_view/form_helper.rb:45:in `fields_for'
actionpack (3.2.3) lib/action_view/helpers/form_helper.rb:377:in `form_for'
haml (3.1.6) lib/haml/helpers/action_view_mods.rb:183:in `form_for_with_haml'
haml (3.1.6) lib/haml/helpers/xss_mods.rb:132:in `form_for_with_haml_xss'
client_side_validations (3.1.4) lib/client_side_validations/action_view/form_helper.rb:28:in `form_for'
simple_form (2.0.2) lib/simple_form/action_view_extensions/form_helper.rb:33:in `block in simple_form_for'
simple_form (2.0.2) lib/simple_form/action_view_extensions/form_helper.rb:51:in `with_simple_form_field_error_proc'
simple_form (2.0.2) lib/simple_form/action_view_extensions/form_helper.rb:32:in `simple_form_for'
app/views/user_steps/occasions.html.erb:1:in `_app_views_user_steps_occasions_html_erb___2581036131298452069_70258891699320'
actionpack (3.2.3) lib/action_view/template.rb:143:in `block in render'
activesupport (3.2.3) lib/active_support/notifications.rb:125:in `instrument'
actionpack (3.2.3) lib/action_view/template.rb:141:in `render'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:18:in `render'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:110:in `_render_template'
actionpack (3.2.3) lib/action_controller/metal/streaming.rb:225:in `_render_template'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:103:in `render_to_body'
actionpack (3.2.3) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
actionpack (3.2.3) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:88:in `render'
actionpack (3.2.3) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.3) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/nelsonkeating/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
activesupport (3.2.3) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.3) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:39:in `render'
remotipart (1.0.2) lib/remotipart/render_overrides.rb:8:in `render'
wicked (0.1.5) lib/wicked/controller/concerns/render_redirect.rb:26:in `render_step'
wicked (0.1.5) lib/wicked/controller/concerns/render_redirect.rb:18:in `render_wizard'
app/controllers/user_steps_controller.rb:11:in `show'
actionpack (3.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.3) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.3) lib/active_support/callbacks.rb:425:in `_run__2706915168785360702__process_action__2447852392914763718__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
activerecord (3.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.3) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.3) lib/journey/router.rb:68:in `block in call'
journey (1.0.3) lib/journey/router.rb:56:in `each'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:600:in `call'
rack-pjax (0.5.9) lib/rack/pjax.rb:12:in `call'
client_side_validations (3.1.4) lib/client_side_validations/middleware.rb:18:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.3) 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:25:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.2) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.3) 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.3) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.3) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `_run__2512277106516780401__call__4355055174989828965__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) 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.3) 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.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.3.1) lib/thin/connection.rb:78:in `catch'
thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.3.1) lib/thin/connection.rb:53:in `process'
thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
thin (1.3.1) lib/thin/server.rb:159:in `start'
rack (1.4.1) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.1) lib/rack/server.rb:265:in `start'
railties (3.2.3) lib/rails/commands/server.rb:70:in `start'
railties (3.2.3) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.3) lib/rails/commands.rb:50:in `tap'
railties (3.2.3) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

Models

   class User ActiveRecord::Base
     has_many :occasions   
    end



    class Occasion < ActiveRecord::Base
      belongs_to :user
      attr_accessible :date, :name, :pname, :user_id, :interest_ids
      has_many :person_interests, :as => :person
      has_many :interests, :through => :person_interests

    end

    class PersonInterest < ActiveRecord::Base
      attr_accessible :person_id, :person_type, :interest_ids
      belongs_to :interest
      belongs_to :person, :polymorphic => true

    end


    class Interest < ActiveRecord::Base
      attr_accessible :name
      has_many :person_interests


      def people
        person_interests.includes(:person).map(&:people).flatten.uniq
      end

    end

user_steps_controller.rb

 def show
      @user = current_user
      @user.friends.build
      @user.anniversaries.build
      @user.occasions.build
      render_wizard
    end

View

<%= simple_form_for @user, url: wizard_path do |f| %>
  <div id="single_module">
  <div class="pitch">
  <h2 class="signup">Step 5: Custom Occasions</h2>
  </div>
  <div id="input1" style="margin-bottom:4px;" class="clonedInput">

  <ul class="testss1">
  <%= f.simple_fields_for :occasions do |occasion_o| %>
    <li><%= occasion_o.input :name, :placeholder => 'Enter occasion Name' %></li>
    <li><%= occasion_o.input :pname, :placeholder => 'Enter persons Name (if necessary)' %></li>
    <li><%= occasion_o.input :date, :as => :date_picker, :input_html => { :class => 'special' } %></li>
   </ul>

    <h3>Related Interest</h3>

    <li><%= occasion_o.association :interests, :label => false, :as => :check_boxes %></li>



    <%end%>
    </br>
    </div>
    <%= link_to "skip this step", next_wizard_path %>
    <%= f.button :submit, 'Submit' %>
    <%end%>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:06:39+00:00Added an answer on June 5, 2026 at 9:06 am

    You need to enable nested attributes for :occasions in your model:

    class User ActiveRecord::Base
      has_many :occasions   
      accepts_nested_attributes_for :occasions
    end
    

    Otherwise the form builder does not not how to use the Occasion object that you’re building in the controller, so it’ll just use the :occasions symbol as “object”, giving you this error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a has_many through association and having trouble getting the before_destroy call
I am getting this error: An association from the table dbo.AccountGroup refers to an
I am trying to use a nested form but keep getting this error when
I'm attempting to setup an app using django-openid and openid. I'm getting the following
Getting message expected identifier in red for below these two statements } else if
Getting 'Dispatcher has no subscribers' error while trying to post message to a channel
Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
This was working just fine, not sure what broke it, but now I'm getting
I am getting a named_scope error, am i trying to use it incorrectly? class
I am using Rails 3 and trying to set up an association with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.