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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:08:33+00:00 2026-06-11T23:08:33+00:00

I am new to rails. Today I encountered a problem that I have no

  • 0

I am new to rails. Today I encountered a problem that I have no clue how to fix it.
Basically I am trying to put a input area and a submit button on one webpage, and the input values is stored in the params[:name], passing to the export_issues method defined in issues controller.
this is what the view file looks like

    <%= form_tag(:controller => 'issues', :action => 'export_issues') do%>
    <p>
    <%= label_tag :name, "name:" %>
    <%= text_field_tag :name, params[:name]%>
    </p>
    <%= submit_tag "Submit"  %>

when i click the ‘Submit’ I got “Routing error”. But if I just press F5 refresh the error pageor type 127.0.0.1/issues/export_issues it will work just as I wanted

and this is the code related to issues controller in routes.rb

resources :issues, :only => [:index, :destroy] do
  member do
    post 'create_comment'
    get 'mark_readed'
end
collection do
  get 'export_issues'
  delete 'destroy_comment'
end
end

basically what the export_issues does is to read the database and export data to a CSV file.
It worked fine without the form_tag codes taking part in.

So what is the problem ?

  • 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-11T23:08:34+00:00Added an answer on June 11, 2026 at 11:08 pm

    The reason is simple. By default form_tag creates form element with method=post. Like:

    form_tag('/myposts')
    

    will create form tag as follows:

    <form action="/myposts" method="post">
    

    However, our routing says, it accepts only get. So, the form opening tag should be:

    <%= form_tag(:controller => 'issues', :action => 'export_issues', :method => :get) do%>
    

    For more information, please consult the apidocs.

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

Sidebar

Related Questions

Currently I have a Rails 3 app that subscribes new users up to MailChimp.
I've installed Aptana Studio 3 today, and been trying to create a new Rails
I have never had a problem starting a new app, but today I got
bonjour dudes. i have a small problem with rails. today i install rails 3
I did a rails new today, then created a simple search bar: <form> <input
Hi friends i came with a new problem. In my rails app i have
Starting a new rails project and we have a well-thought-out color palette, and want
I've just started a brand new rails project and the first task I'm trying
I am trying to start a new Rails project but I am getting a
I've got a cucumber step that is trying to populate objects, including a new

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.