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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:53:51+00:00 2026-06-05T21:53:51+00:00

NOTE: I have read Routing From the Inside Out AND the Engine Yard blog

  • 0

NOTE: I have read Routing From the Inside Out AND the Engine Yard blog post on routing.

I’m building a fantasy sports league, I have a League model that supports the seven basic restful operations, and they all work fine.

I’ve added the following my routes.rb

  resources :leagues do
    member do
      get :invite
      post :sendem
    end

Later in the file I have a resources :leagues for the basic actions

and when I rake routes I can see:

invite_league GET    /leagues/:id/invite(.:format)      {:action=>"invite", :controller=>"leagues"}
sendem_league POST   /leagues/:id/sendem(.:format)      {:action=>"sendem", :controller=>"leagues"}

which is what I would expect. I have two functions in the League controller: “invite” which creates the form for collecting email addresses, and “sendem” which invokes a mailer to actually send the invitations.

The get for /league/:id/invite does indeed produce the form.
The form tag I am using looks like:

<%= form_tag(sendem_league_path, :method => "post") do %>

and yet the HTML that is rendered looks like:

<form accept-charset="UTF-8" action="/leagues/1" class="edit_league" id="edit_league_1" method="post">

And hence on submit generates a PUT which is completely wrong. (It should post to the sendem function.) My change to the routes file appears above the generic resources :leagues line, so it should have a higher priority.

I’m sure there is something dead-simple that I missed but I’m out of ideas. (And hair).

  • 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-05T21:53:52+00:00Added an answer on June 5, 2026 at 9:53 pm

    ARGH some form handling error code at the top (form for @league) created a second form on the page for editing…. (left out of code snippets above for brevity). Original code seems to work as expected with that other code commented out. Thanks to vladdruzh for convincing me I was on the right track and to Salil for making me think to read the rendered HTML top to bottom.

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

Sidebar

Related Questions

note from N00B land again. I have read lots about sorting arrays - wanted
I have read on MSDN( see Important note ) that RSACryptoServiceProvider must be disposed.
Note I have completely re-written my original post to better explain the issue I
I have read many sites, guides, etc; also note I cannot test what I
From the examples that I have read and from the documentation on MysqlConnectionPoolDataSource at
Note : I have read other posts on how to lock and unlock a
I have a tun/tap device which is used to read incoming packets from one
Note: I have read through the last 150 svn commit error questions and none
(NOTE: I have read http://shiningthrough.co.uk/Select-helper-methods-in-Ruby-on-Rails , but still don't know what to pick) I
I have a dictionary of values read from two fields in a database: 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.