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

  • Home
  • SEARCH
  • 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 4555712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:15:52+00:00 2026-05-21T17:15:52+00:00

The following link works in my app: <%= link_to invitation, :controller => :invitations, :action

  • 0

The following link works in my app:

<%= link_to "invitation", :controller => :invitations, :action => :index %>

To follow restful conventions i changed the link to:

<%= link_to "invitation", index_invitation_path %>

The error that i get is:

undefined local variable or method `index_invitation_path'

Rake routes yields:

invitations GET    /invitations(.:format)          {:controller=>"invitations", :action=>"index"}

The page name is index.html.erb. The model is invitation.rb. The controller is invitation_controller.rb. Routes has resources :invitations. What am i missing?

Thanks!

  • 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-21T17:15:53+00:00Added an answer on May 21, 2026 at 5:15 pm

    Assuming you have the routing correct:

    resources :invitations
    

    Then the correct helper for the index action (with the url /invitations.html) is

    invitations_path
    

    You can see more information by running rake routes. It will display text like the following:

                 lists GET    /lists(.:format)
               {:action=>"index", :controller=>"lists"}
                       POST   /lists(.:format)
               {:action=>"create", :controller=>"lists"}
              new_list GET    /lists/new(.:format)
               {:action=>"new", :controller=>"lists"}
             edit_list GET    /lists/:id/edit(.:format)
               {:action=>"edit", :controller=>"lists"}
                  list GET    /lists/:id(.:format)
               {:action=>"show", :controller=>"lists"}
                       PUT    /lists/:id(.:format)
               {:action=>"update", :controller=>"lists"}
                       DELETE /lists/:id(.:format)
               {:action=>"destroy", :controller=>"lists"}
                  root        /(.:format)
               {:controller=>"lists", :action=>"index"}
    

    The above was from a route of my own (for a model called List). The route helper method is shown immediately before the HTTP method. You have to remember to append the _path to each helper method. For example the helper methods I could use are:

    list_path(list)
    edit_list_path(list)
    new_list_path
    lists_path
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm working on an asp.net app, the following link works in IE but not
The following site only works if you are offline. Link So how do they
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.
I have the following tag partial %span.tag-label = link_to #{tag} , :controller => searches,
I am using the code listed on the following link: http://www.magentocommerce.com/wiki/5_-_modules_and_development/catalog/programmatically_adding_attributes_and_attribute_sets Everything works until
I'm trying to test a link that calls a controller action using ajax. Essentially,
Could someone take a look at the following link of a work in progress
I have the following link function MyLinqToSQLTable.Where(x => x.objectID == paramObjectID).ToList(); I most of
In the following link <a href=\#\ onclick=javascript:print(\\) style=\color:blue;\>Print</a> <script> function print() { //How to
With reference to the following link: http://docs.python.org/faq/library.html#what-kinds-of-global-value-mutation-are-thread-safe I wanted to know if the following:

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.