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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:04:44+00:00 2026-05-21T19:04:44+00:00

I am building a Kid’s Chore App. In application.html.erb I show a side bar

  • 0

I am building a Kid’s Chore App. In application.html.erb I show a side bar listing the children’s names:

  <div id="side">
    <%= link_to "Home", home_path %><br />
    <% @children.each do |child| %>
        <%= link_to child.name, child_path(child.id) %><br />
    <% end %>
  </div>

Upon clicking a child’s name, I want all chores to be displayed.. The code above will “show” the child when clicked.

I am thinking something like:

        <%= link_to child.name, chore_path %><br />

.. this does not work because:

  1. I then lose the child_id… which I need for them to record their chores
  2. I am routed to http://localhost:3000/chores/1 (I just want the chores index)

How can I keep the child_id as a variable in this example but display the chore index?

Cheers, Chris

Associations below:

class Child < ActiveRecord::Base
  has_many :completion, :dependent => :destroy
  has_many :chores, :through => :completion

class Chore < ActiveRecord::Base
  has_many :completions
  has_many :kids, :through => :completions

class Completion < ActiveRecord::Base
  belongs_to :child
  belongs_to :chore
  • 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-21T19:04:45+00:00Added an answer on May 21, 2026 at 7:04 pm
    link_to child.name, chores_path(:child_id => child.id)
    

    Then you can grab the child id in the action with params[:child_id]

    The link will be to /chores?child_id=1 for example.

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

Sidebar

Related Questions

I´m building a small application with Jquery and PHP. Jquery (index.html) adds Form Fields
Building a client-side swing application what should be notified on a bus (application-wide message
I am building an assistive iOS app for a kid that uses a switch
Building a Django app on a VPS. I am not very experienced with setting
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI
Building an iPhone OS application that will allow users to anonymously post information to
Building a rails B2B application that will have various users. I'm pretty clear on
Building a stand alone WPF application that uses a MSSQL backend. I would like
Building a simple app here; the methods in question: static coin class public static

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.