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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:14:32+00:00 2026-05-23T17:14:32+00:00

This question is a follow up to this previous question: Ruby on Rails: Custom

  • 0

This question is a follow up to this previous question: Ruby on Rails: Custom actions

As a follow up, what would be the syntax to use a custom action in a form_for? For my app, I have a partial called _invite_form.html.erb, and set the form to have a :url specification that I thought would link the form to the invite action on the Users controller:

 <div id = "invite_form">
<h1>Invite</h1> 
<%= form_for(invited, :url => invite_user_path) do |f| %>
    <div class="field">
        <%= f.text_field :email, :class => "inputform round", :placeholder => "email" %>
    </div>
    <div class="actions">
        <%= f.submit "Invite", :class => "submit_button round" %>
    </div>  
<% end %>
 </div>

This partial is called on certain pages, and this error is given:

  "No route matches {:action=>"invite", :controller=>"users"}"

In my routes.rb file I have included the appropriate lines:

 resources :users do
     member do
      get :invite
      post :invite
    end
 end

Why is it that the route doesn’t work? How do I change these files to make the form use the action “Invite” on the Users controller?

** Forgot to mention earlier: I defined invited in the Users helper: users_helper.rb:

 module UsersHelper
   def invited
     @invited = User.new(params[:user])
   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-23T17:14:32+00:00Added an answer on May 23, 2026 at 5:14 pm

    As you don’t have a persistent User just yet, make this a collection operation by:

    1. Changing invite_user_path to invite_users_path in your controller
    2. Changing member do to collection do in your routes
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up to a previous question . if I have multiple
OK, this question is actually a follow-up question from my previous one: What would
this is a follow up question of my previous question So I have this
This question is a follow up to my previous question about getting the HTML
This is a follow-up to a previous question I had about interfaces. I received
OK, this kind of follows on from my previous question . What I would
This is somewhat of a follow-up question to this question . Suppose I have
This question is an follow-up of an previous asked question . I've written an
From my previous question for selecting specific html text, I have gone through this
This question is a follow up of my previous question stack growth direction I

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.