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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:03:58+00:00 2026-05-25T01:03:58+00:00

This is a nub question. I have a resource Project which has_many Feeds .

  • 0

This is a nub question. I have a resource Project which has_many Feeds. When I am viewing the list of nested Feeds on the Project page, I have a Delete button to remove that Feed from the Project. It works with this syntax:

<%= link_to 'Delete', [feed.project, feed], :confirm => 'Are you sure?', :method => :delete %>

But that then directs to the page listing all the Feeds, and I instead want it to redirect back to the Project page the user was just at. Is it a matter of changing [feed.project, feed] or is it something else? I don’t quite understand the syntax of link_to well enough yet.

EDIT:
In my feeds_controller.rb, I changed the redirect line to :back

def destroy
project = Project.find(params[:project_id])
@feed = project.feeds.find(params[:id])
@feed.destroy
redirect_to :back

respond_to do |format|
  format.html { redirect_to :back }
  format.xml  { head :ok }
end
end
  • 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-25T01:03:59+00:00Added an answer on May 25, 2026 at 1:03 am

    You must have a look at the controller for this resource. It should be somewhere like app/controllers/projects_controller, where’s there should be an action named destroy. The code that do the redirect must be in there. You’ll have to change the following line:

    redirect_to project_feeds_url(project)
    

    to this

    redirect_to :back
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a nub question, but I don't understand why this works: <script
This will be my last question for the evening and a while. I have
This may seem like a nub question. I’ll be the first to admit my
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw
This is a self-explanatory question: Why does this thing bubble into my try catch's
Suppose it's a nub question, but is there an analog of MySQL's LIKE function
Alright, nub question. I know. Basic response might be Convert.ToInt32(string); But naturally, C# does
This seems incredibly similar to a question I had answered just a few days
This is starting to piss me off real bad. I have this XML code:

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.