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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:54:52+00:00 2026-05-24T16:54:52+00:00

I recently added a new method (called help) to my projects controller (projects_controller.rb), and

  • 0

I recently added a new method (called “help”) to my projects controller (projects_controller.rb), and created a “help.html.haml” in the views directory.

I added the following route in routes.rb:

 resources :users, :only => [:new, :create, :edit, :update, :help]
 resources :projects, :module => 'users' do
   get  :help, :on => :member, :as => :help
 end

My goal is to create a link on a separate view (let’s call it index.html.haml) that would link to help.html.haml. Note: at present my routes is set up to display help with the following URL: http://localhost:3001/projects/id/help

Unfortunately I don’t know how to write the code to link to the help URL listed above. As of now I have the following code in index.html.haml:

 %li= link_to 'quick help', project_path(@project)

but this code only takes me to http://localhost:3001/projects/id. Is it possible to add the “/help” to the URL using the link_to function, or is there a better way to do this?

I sincerely appreciate any help. Thank you so much for your time!

  • 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-24T16:54:53+00:00Added an answer on May 24, 2026 at 4:54 pm

    Let’s take a look at the components of the route you’ve defined:

    get :help, :on => :member, :as => :help
    
    • The first parameter is :help, that’s the name of the action that will be invoked.
    • The second part is :on => :member, which means that the action is scoped on a specific record. So, you’re going to have to pass an id to invoke it.
    • The third part, :as => :help, defines the name of the helper method that you can use to generate the url. That’s what you’re looking for.

    Basically, help_project_path(@project) will generate the url you need. So, the link would look like this:

    %li= link_to 'quick help', help_project_path(@project)
    

    Note that you don’t really need the :as => :help path, it should be help by default. That’s generally used if you want a different helper name.

    Another thing I’d like to point out is that you’re not creating “a link to help.html.haml”, you’re creating a link to the help action on the projects controller. The action can redirect somewhere if it’s necessary, you don’t have to render the view. I’m just saying this, because it sounds like you’re still a bit new to this, sorry if I’ve simply misunderstood.

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

Sidebar

Related Questions

I recently added a feature to a large application written in Delphi (version 2009)
We recently added auditing to our database. A colleague implemented it using triggers and
I recently asked this question: Expose XML or Objects - thanks all for the
Recently I came across some strange behaviour of my application. It has been developed
Recently, I was discussing with another programmer the best way to refactor a huge(1000
I have an application that works some what similar to how iPhone's Contact application
It's a trivial task to find out if an object is referenced by something
Quick background: I'm programming in PHP, I have a domain model with a separate
I am facing strange issue with our WCF service. The same code was working
Argh! Everything has been totally fine, then all of a sudden I started getting

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.