Reputation: 31
@story = Story.create(story_params, listing_id: @listing.id)
Story belongs to listing, I'm trying to have it so upon creation the listing id is passed in so the story is attached to that listing. However, I am getting the following error upon trying to use this.
wrong number of arguments (2 for 1)
on line:
@story = Story.create(story_params, listing_id: @listing.id)
How should I be doing this?
Upvotes: 0
Views: 29