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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:38:59+00:00 2026-05-26T02:38:59+00:00

I created a scaffolding gem that uses another gem to generate presenters. I created

  • 0

I created a scaffolding gem that uses another gem to generate presenters. I created this scaffolding generator using the Rails 3 generators. It works like this:

rails g stager:scaffold User

I created another gem to generate presenters. I want to use this gem to generate a presenter with each scaffold. Currently I’m doing the following to accomplish this:

run "rails g exhibit:presenter #{scaffold_name}"

The problem is that it seems to reload the Rails environment when this generator is called, making it a bit slow. I’m wondering if there’s a better way to call another generator within a generator. So: is there a better way to create a Rails generator inception? 😉

  • 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-26T02:38:59+00:00Added an answer on May 26, 2026 at 2:38 am

    You must define a hook_for the other generator in your generator class. The ScaffoldGenerator is probably the best example of this, as it has a hook for the scaffold_controller generator.

    If you want to pass in arguments to your generator, it’s probably better to use something like the hook_for examples further down in this file for assets and stylesheet engine.

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

Sidebar

Related Questions

In the functional test that is created by Rails (when generating a model using
I generated a model User using scaffolding script/generate scaffold user username:string crypted_password:string email:string active:boolean
http://localhost:3000/genre I'm using Instant Rails, I'm introducing scaffolding for the first time ever. So
I'm using acts_as_taggable_on in my rails app. I'd like these tags to show up
I have an existing entity that has been created by scaffolding. Now I'm realizing
I created, using the scaffolding, a model and controller files. Later I discovered it
With ruby on rails, the scaffolding creates layouts for all the controllers. If I
Created .NET WCF service, tested it - works. Generated schemas from Data and service
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I created a few mediawiki custom tags, using the guide found here http://www.mediawiki.org/wiki/Manual:Tag_extensions I

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.