Note that there are some explanatory texts on larger screens.

plurals
  1. PODIsplay content from a specific column
    primarykey
    data
    text
    <p>First off I'm a total Rails newbie (front-end guy looking to learn rails), so bear with me. </p> <p>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.</p> <p>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.</p> <p>Now the code, this is whats in my projects controller:</p> <pre><code> def show @project = Project.find(params[:id]) @project_process = ProcessList.where(:id =&gt; @project.process_list_id) respond_to do |format| format.html # show.html.erb format.json { render json: @project } end </code></pre> <p>end</p> <p>And in my view:</p> <pre><code>&lt;%= @project_process.all %&gt; </code></pre> <p>^^ This works great to display the whole row like so: </p> <blockquote> <p>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></p> </blockquote> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload