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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:25:15+00:00 2026-06-01T16:25:15+00:00

I’m working through Ryan Bates’ Railscast #124: Beta Invitations. I’ve got all the code

  • 0

I’m working through Ryan Bates’ Railscast #124: Beta Invitations. I’ve got all the code in place, but I haven’t been able to actually get things working. When I try to send an invite email, I get this message.

    Routing Error       
    No route matches [POST] "/invitations"

If I pluralize the resource’s name in Routes.rb, I get a different routing error.

    Routing Error
    uninitialized constant InvitationsController

What am I doing wrong?

Here’s my Routes.rb file.

  resources :users, :invitation
  resources :sessions, :only => [:new, :create, :destroy]

  match '/hunts', :to => 'hunts#index'

  match '/signup/',  :to => 'users#new'
  match '/signin',  :to => 'sessions#new'
  match '/signout', :to => 'sessions#destroy'
  match '/contact', :to => 'pages#contact'
  match '/about',   :to => 'pages#about' 
  match '/help',    :to => 'pages#help'

  root :to => "pages#home"
  match ':controller(/:action(/:id(.:format)))'
end

And my Invitation Controller.

class InvitationController < ApplicationController

  def new
    @invitation = Invitation.new
  end

  def create
    @invitation = Invitation.new(params[:invitation])
    @invitation.sender = current_user
    if @invitation.save
      if logged_in?
        Mailer.deliver_invitation(@invitation, signup_url(@invitation.token))
        flash[:notice] = "Thank you, invitation sent."
        redirect_to root_path
      else
        flash[:notice] = "Thank you, we will notify when we are ready."
        redirect_to root_path
      end
    else
      render :action => 'new'
    end
  end

end

Update: Here’s the info requested.
Views/invitation/html.erb

    <%= form_for @invitation do |f| %>
      <p>
        <%= f.label :recipient_email, "Friend's email address" %><br />
        <%= f.text_field :recipient_email %>
      </p>
      <p><%= f.submit "Invite!" %></p>
    <% 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-06-01T16:25:17+00:00Added an answer on June 1, 2026 at 4:25 pm

    rake routes is a very useful tool which you can use to see all the routes defined for your application.

    You have added resources :invitation which defines the following routes

    invitation_index GET    /invitation(.:format)          invitation#index
                     POST   /invitation(.:format)          invitation#create
      new_invitation GET    /invitation/new(.:format)      invitation#new
     edit_invitation GET    /invitation/:id/edit(.:format) invitation#edit
          invitation GET    /invitation/:id(.:format)      invitation#show
                     PUT    /invitation/:id(.:format)      invitation#update
                     DELETE /invitation/:id(.:format)      invitation#destroy
    

    Note that you are calling the InvitationController‘s actions.

    So nothing is wrong with your route -> controller mapping.

    You are just posting to a non-existent route. When you pluralize the route’s name, you end up having a non-existent controller (InvitationsController).

    Just change the URL you’re posting to and you’re good to go.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including but

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.