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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:31:30+00:00 2026-06-06T16:31:30+00:00

First off I’m a total Rails newbie (front-end guy looking to learn rails), so

  • 0

First off I’m a total Rails newbie (front-end guy looking to learn rails), so bear with me.

I’m making a simple todo-ish app to help myself learn and have run into an issue. I’m assuming this is something super simple that I’m missing but here goes.

In my app users can create a number of “process_lists” (basically a list of tasks to complete). They also create “projects”. Each project has a “process_list” associated with it. Process_lists are reusable, basically a set of steps to complete a project. One process list can be used for mnay projects. I’ve tagged the database table for projects with a column called “process_list_id” to help with associations. This is done when the user creates a project.

Now the code, this is whats in my projects controller:

   def show
@project = Project.find(params[:id])
@project_process = ProcessList.where(:id =>  @project.process_list_id)

respond_to do |format|
  format.html # show.html.erb
  format.json { render json: @project }
end

end

And in my view:

<%= @project_process.all %>

^^ This works great to display the whole row like so:

ProcessList id: 6, name: “Derp Derp Derp Derp “, steps: nil, description: “lasdjlsdjsadas”, created_at: “2012-06-22 16:21:41”, updated_at: “2012-06-22 16:21:41”, step1: “sjkdfldsjf”, step2: “alkdfjdlfj”, step3: “lakdfjdljf”, step4: “”, step5: “”, step6: “”, step7: “”, step8: “”, step9: “”, step10: “”, step11: nil, step12: nil, step13: nil, step14: nil, step15: nil, step1_description: “klsdjfldskjf”, step2_description: “sldjfldskjflsdkfjdls”, step3_description: “lkdsfjdlkfjsd”, step4_description: “”, step5_description: “”, step6_description: “”, step7_description: “”, step8_description: “”, step9_description: “”, step10_description: “”, step11_description: nil, step12_description: nil, step13_description: nil, step14_description: nil, step15_description: nil>

Now what I want to do is display certain columns from this row. For example “step1”. It seems really simple but I’ve tried a number of thing and googled for hours now and I can’t figure it out. Any help would be great.

  • 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-06-06T16:31:32+00:00Added an answer on June 6, 2026 at 4:31 pm

    To directly answer your question:

    <%= @project_process.first.step1 %>
    

    This will print out the value of the step1 column, “sjkdfldsjf” in your case.

    If you have the line has_one :process_list in your class Project, then you can assign the @project_process variable much easier: @process_list = @process.process_list. You may also put belongs_to :process in the ProcessList class, so you have access to the process from the list object.

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

Sidebar

Related Questions

First off, The Problem: We have a Web App with a Flash front-end that
First off, kudos to the amazing apache cordova team for making a platform-independent native-like
First off, I'm not a math guy, so large number precision rarely filters into
First off, I'm sure this is a simple question. I'm just getting started with
First off, I'm following the practice found here for Rails concerns (great idea!): https://gist.github.com/1014971
first off I'm a noob to PHP but here is my problem. I am
First off, I'm coming (back) to Java from C#, so apologies if my terminology
First off, I would like to make clear, that I am SUPER NEW TO
First off I use this code to make the navigation bar always stay fixed;
First off, the function in question. bool Animation::loadFrames() { sf::Texture frame[frameCount]; std::string pathToFrame; for(int

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.