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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:18:45+00:00 2026-05-24T21:18:45+00:00

I have a workflow app written in Rails and there are a number of

  • 0

I have a workflow app written in Rails and there are a number of prompts which the user will go through. When these prompts/manual actions are “proceeded” a time stamp is stored against the a workflow model.

Code looks something like so

class Workflow < ActiveRecord::Base

end

class OpenBook < ActiveRecord::Base
  belongs_to :workflow, :polymorphic => true
end

class ReadFirstPage < 
  belongs_to :workflow, :polymorphic => true
end

At the moment each workflow item ( OpenBook ) and spits out a bit of text (set in the model) and a forward / backward button on the view. The controllers for these workitems also do the similar things (new, done, edit, proceed, rewind).

Ideally I would like to just use the same controller and views and just change the model. Is theer something I can do with the routes eg?

resources :open_books, :controller => "workflow_item"

Im not sure how I would go about getting the correct assignments in the controller.

Or am I just doing this completely wrong and I should be using helpers?

  • 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-24T21:18:48+00:00Added an answer on May 24, 2026 at 9:18 pm

    You might have an easier time using a series of controllers for each specific object type that inherit from a common parent. That way most of the duplication can be in the base class where only the differences are expressed in the children.

    To ensure your templates are rendered correctly, you may have to specify the full path to them or it will look for customized versions:

     def index
       # ...
       render(:template => 'parent/index')
     end
    

    Usually this is redundant, but in your case you may need it or it will default to showing the non-existent child-template first.

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

Sidebar

Related Questions

I have a workflow in my app where the user will build a compound
In my Rails app, I have a form which redirects through a foreign service,
I have the following workflow I am looking for a Rails app: Parse incoming
I have written a web app in PHP which makes use of Ajax requests
In our Rails app that runs in Facebook canvas, we have a workflow where
In my Workflow Foundation 4.0 RC app I have a 'Receive' and 'SendReplyToReceive' WCF
I have two workflow foundation (.NET 3.5 SP 1) application which compiles fine. It
I have a Workflow 4.0 app that generates emails. In a dialog for creating
I currently have this workflow in a tab based app: Tab1 loads... ViewOne :
I am sketching out the workflow of an app where you have a main

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.