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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:26:33+00:00 2026-05-21T15:26:33+00:00

I am new to rails and I am creating a basic blog application. When

  • 0

I am new to rails and I am creating a basic blog application.

When I have created a post it has an author. If you locate the author it displays a list of posts that have been created by that author on their own individual page. Each of these links can be selected.

I want to now create a link on each post page which displays the name of the author and then allows you to select this and go back to the author’s individual page.

So far I have added the following code to the pages view:

<%= link_to 'Back to List of Authors', authors_path %>

I’m now not sure how to change it so that instead if saying 'Back to List of Authors' it displays the authors name and allows it to be selected and takes the user back to the author’s individual page. Currently it takes you back to the complete list of authors and not in individual author.

Any advice will be appreciated.

  • 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-21T15:26:34+00:00Added an answer on May 21, 2026 at 3:26 pm

    Something like this should work:

    <%= link_to "Back to #{@post.author.name} page", @post.author %>
    

    This is working under the assumption that you have a instance variable @post that has the post data, and author belongs_to post.

    Of course a more verbose way is to explicitly state the route like so:

    <%= link_to "Back to #{@post.author.name} page", author_path(@post.author) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am new to Rails, so pardon the basic question. I see rails
I'm creating a new rails app for my business, and I just finished a
I'm creating a Rails application, and I've hit a bit of a snag. I
I am new to rails so excuse the simple questions. I am creating a
I'm new to rails, so be nice. I'm building a rolodex type application, and
I'm new to rails and building a small test app on rails3 (beta4). I
I am new to rails so sorry if this is easy. I am wondering
So I am beginning to work with Rails and I get some of the
I'm trying to model a card game in order to learn Rails. This is
I am designing a game to be played in the browser. Game is a

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.