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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:17:43+00:00 2026-05-22T15:17:43+00:00

My app is simple : A controller :main with 3 actions : welcome,form_receiver and

  • 0

My app is simple :

A controller :”main”
with 3 actions : “welcome”,”form_receiver” and “result”

and 2 views : “result.html.erb” and “welcome.html.erb”

All I want to do is posting the form in “welcome.html.erb” to the action “form_receiver” and show some result in the “result” action.

But after post the form, I get the error :Routing Error No route matches “/main/form_receiver”
,through I am quite sure that I have include the path in routes.

BELOW ARE MY CODE

controllers/main_controller.rb :

class MainController < ApplicationController
  def welcome
    #Nothing
  end

  def form_receiver
    @p = params[:customer]
    redirect_to :controller => "main",:action=>"result"
  end

  def result

  end
end

views/main/welcome.html.erb :

<h1>Main#welcome</h1>
<%= form_tag :controller => 'main',
             :action     => 'form_receiver'  do%>
<p>name : <%= text_field "customer","nick" %> </p>
<p>pwd : <%= password_field "customer","password" %></p>
<p><input type="Submit" value="sign up"/> </p>
<% end %>

views/main/result.html.erb :

<%=@p['cick']%>
<%=@p['password'] %>

config/routes.rb :

TestForm::Application.routes.draw do
  get "main/welcome"

  get "main/result"

  get "main/form_receiver"
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-22T15:17:44+00:00Added an answer on May 22, 2026 at 3:17 pm

    As you said, you are posting to form_receiver. But you wrote get in the routes.rb.

    So you should:

    post "main/form_receiver"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My main view controller (representing the Main Menu in my app) has a simple
I have a simple app with a full screen UIWebView. This contains HTML generated
I'm writing a simple app that's going to have a tiny form sitting in
I am working on a simple app in Sinatra with DataMapper. I want to
I have a regular old iPhone app that has a main view controller that
I run the simulator on a very simple app- a navigation controller contained in
In my iPhone app, I must have around 9-15 different views, all available from
In a simple app I'm working on, I've got three related assemblies: MyCompany.Geography.Windows.Forms which
I have a simple app that uses an SQL Express 2005 database. When the
I need a simple app to edit database tables. Are there any code generators

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.