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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:42:10+00:00 2026-06-16T06:42:10+00:00

I try to ask my question more clearly because I think that people didn’t

  • 0

I try to ask my question more clearly because I think that people didn’t understand me:

I have an application of: TODO LIST in RUBY ON RAILS.

I want to create something like:

enter image description here

I succeeded to create the first part (Tasks Workers), but only the: name, num_of_tasks, num_tasks_left.

now I want to create the: “Show Tasks”.

when the user pressed the link of: “tasks”, he will be direct to a page with all of the tasks (with options for edit and delete).

for example, if the user pressed the link of “tasks” in the line of a person with a name of “Alon”, he would direct to a page that will show him the second part (Tasks Of Alon).

what should I need to add in order to get this output? for meantime I have a tasks_controller.

before I explain another thing, I want to let you know about the first part (Tasks Workers). there is a variable: name. in each row, I print the variable name (he passes all the database).

Why can’t I do the next steps?

1) add a variable in tasks_controller:

def show_tasks
    @tasks = Task.where(:name => params[:name])
    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @tasks }
    end
end

2) define: show_tasks.html.erb that will show the second part(Tasks Of X)

3) create a link in index.html.erb by:

<td><%= link_to 'tasks', show_tasks_path(name) %></td>

and then for each line, the ‘name’ variable will be sent to show_tasks.html.erb.

thanks for help!

  • 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-16T06:42:11+00:00Added an answer on June 16, 2026 at 6:42 am

    You should use nested resources. Google can help you to find documentation about it.
    (or click here: http://guides.rubyonrails.org/routing.html#nested-resources )

    Basically, you would have 2 controllers in your case:
    TasksController and WorkersController (or TaskWorkersController)

    Your routes.rb should contain something like this:

    # routes.rb
    resources :workers do
      resources :tasks
    end
    

    This will generates the Paths & Helpers you need. Refer to the doc, if you can’t find how to do it I can help you a little but it shouldn’t be too hard 😉

    Some tips:

    Your show_tasks action will become the index action of the TasksController, which would be like:

    @tasks = Task.where(worker_id: params[:id]) # works if your declared Task belongs_to Worker
    

    Your action where you display all the Workers (Alon, Dan, etc) will be the index action of the WorkersController.

    Good luck!

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

Sidebar

Related Questions

hihi i have a question that i want to ask about c# and window
i would like to ask a question about @UsesJAXBContext annotation in jax-ws. I try
Not sure how to ask this, but i'll give it a try: I have
before I ask my question I wanted to let everybody know that I appreciate
I followed by the tutorial for devise: http://railscasts.com/episodes/209-introducing-devise I ask this question because localhost:3000/users/registration/sign_up
I'm going to re-ask this question in a slightly different way. Say I have
First let me ask a general question: It seems to me that C++ is
This question seems like something very obvious to ask, and yet I spent more
I am going to try to ask this question without supplying too much source
I have a very vague questions to ask about a crashing android application. Users

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.