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 7534455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:01:14+00:00 2026-05-30T06:01:14+00:00

OK, the scenario is: i`m trying to keep 3 nested forms on the same

  • 0

OK, the scenario is: i`m trying to keep 3 nested forms on the same controller. The relation between the user and shop is working smoothly the problem arises between the shop and shop_type.
So, when i try update the shop_type info in shop edit view

Spit out this error: ShopType(#70233617878800) expected, got ActiveSupport::HashWithIndifferentAccess(#70233610891660)

i searched already about this on api docs but but still a mystery for me why the shop_type is passing as a hash.

thanks.

ShopsController

def new
   @user = current_user
   @shop = @user.build_shop.shop_type

   end


   def create
     @user = current_user
      @shop = @user.build_shop(params[:shop])
          if  @shop.save   
        flash.now[:success] = "blah"
         render :edit
      else
        render  :new 
    end
  end

   def edit
 @user = current_user
  if @shop = current_user.shop 
   render :edit
  else render :new
   end
 end


   def update   
       @user = current_user
           @shop = current_user.shop
        if @shop.update_attributes(params[:shop])
         flash.now[:success] = "blah"
         render :edit
      else
        render  :edit
    end
  end 
end

ShopModel

 belongs_to :user
 belongs_to :shop_type

Shop_typeModel

has_many :shops
  accepts_nested_attributes_for :shops 
 attr_accessible :shops, :shop_attributes
  • 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-05-30T06:01:15+00:00Added an answer on May 30, 2026 at 6:01 am

    I find out, still not clear why i have to use :shop_type_id instead of just :shop_type on fields_for.

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

Sidebar

Related Questions

The scenario is trying to adjust font size to get a nice graphic arrangement,
I'm trying to write a Cucumber scenario that requires me to have a logged
I am trying to simulate a scenario where connection to the server of one
I'm trying to implement this scenario using Unity and i can't figure out how
I'm trying to do the classic Insert/Update scenario where I need to update existing
I am trying to use JQuery in my ASP.Net 2.0 website in this scenario:
I'm trying to build a query with hibernate criteria for the following scenario: Two
I am trying to wrap my head around doing validation in a MVC scenario.
I am trying to build an SQL Statement for the following search scenario: I
I'm trying to find a good way to handle the following scenario (I'm still

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.