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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:22:07+00:00 2026-05-21T10:22:07+00:00

I have friendly_id and ActiveScaffold installed for my Rails application. Because not all of

  • 0

I have friendly_id and ActiveScaffold installed for my Rails application.

Because not all of my models have unique name fields I have to use the Slugged Model to make it work. friendly_id does the job flawlessly I have friendly URLs and I can load the objects using the friendly id.

But when I want to create a new object with ActiveScaffold, it says the following error message:

ActiveScaffold::ReverseAssociationRequired
(Association slugs: In order to
support :has_one and :has_many where
the parent record is new and the child
record(s) validate the presence of the
parent, ActiveScaffold requires the
reverse association (the belongs_to).)

Of course I cannot create the belongs_to association in that side because it’s created by the friendly_id module and every model which works slugged way should be included there.

The model looks like this:

class FooBar < ActiveRecord::Base
  has_friendly_id :name, :use_slug => true, :approximate_ascii => true
end

In my ApplicationController:

class Admin::FooBarsController < Admin::ApplicationController
  active_scaffold :foo_bar do |config|
    config.list.columns = [ :id, :name ])
    config.update.columns = [ :name ]
    config.create.columns = config.update.columns
  end
end

Is there a way to make this work?

The versions: friendly_id 3.2.0, ActiveScaffold latest in the rails-2.3 git branch.

UPDATE: Seems like it does not conflict in production mode.

  • 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-21T10:22:08+00:00Added an answer on May 21, 2026 at 10:22 am

    calling

    has_friendly_id :name, :cache_column => 'cached_slug', :use_slug => true
    

    … creates a has_many and a has one associations pointing to a slug AR model which hasn’t any polymorphic belongs to association properly defined.

    So basically what you need to do to solve this error is to define the reverse associations in the controller of your parent model (the one who has friendly_id stuff)

      active_scaffold :products do |config|
        ...
        config.columns[:slug].association.reverse = :product
        config.columns[:slugs].association.reverse = :product
      end
    

    and it works 🙂

    PS : I use friendly_id as gem and ActiveScaffold VHO master branch for rails 3

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

Sidebar

Related Questions

I have red docs on friendly_id for rails. It's easy: you set a certain
I have a Rails blog using friendly_id for creating custom urls. The blog has
Using: Rails 3.0.3 Friendly_id: 4.0.0.beta11 I have create a fully working development version of
I'm working on a Rails 3.2.2 application which has JSON APIs and I use
I have a website with friendly urls. I want all url´s that end with
I'm using the friendly_id gem. I also have my routes nested: # config/routes.rb map.resources
I'm using the friendly_id plugin to generate SEO-friendly URLS for some of my models.
I am trying to use the friendly_id gem to generate a slug in the
I have seen some posts about navigation and breadcrumbs but did not find the
I have a Rails app with impressionist and friendly id, I want to show

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.