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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:30:46+00:00 2026-05-31T18:30:46+00:00

In a Ruby on Rails form, I’m trying to use a button instead of

  • 0

In a Ruby on Rails form, I’m trying to use a button instead of link_to to go back to a main menu. I used the following (which I found from browsing this forum) :

<form><a href=/home/index><button>Main Menu</button></a></form>

If I mouse over the button, I see http://172.19.95.56:3005/home/index, which is a valid page that I can see on my browser, and that’s where I want the button to take me, but if I click on that button, it takes me to http://172.19.95.56:3005/l2vpns/1/edit, and I see the following logs on the Rails server :

Started GET "/l2vpns/1/edit" for 172.24.67.151 at 2012-03-21 10:44:26 -0700
Processing by L2vpnsController#edit as HTML
Parameters: {"id"=>"1"}
L2vpn Load (0.4ms)  SELECT "l2vpns".* FROM "l2vpns" WHERE "l2vpns"."id" = ? LIMIT 1  [["id", "1"]]
Rendered l2vpns/_form.html.erb (65.7ms)
Rendered l2vpns/edit.html.erb within layouts/application (66.5ms)
Completed 200 OK in 81ms (Views: 76.6ms | ActiveRecord: 1.2ms)

My routes are the following:

[root@localhost pocplus]# rake routes
apply_configs_l2vpns GET    /l2vpns/apply_configs(.:format)        {:action=>"apply_configs", :controller=>"l2vpns"}
          l2vpns GET    /l2vpns(.:format)                      {:action=>"index", :controller=>"l2vpns"}
                 POST   /l2vpns(.:format)                      {:action=>"create", :controller=>"l2vpns"}
       new_l2vpn GET    /l2vpns/new(.:format)                  {:action=>"new", :controller=>"l2vpns"}
      edit_l2vpn GET    /l2vpns/:id/edit(.:format)             {:action=>"edit", :controller=>"l2vpns"}
           l2vpn GET    /l2vpns/:id(.:format)                  {:action=>"show", :controller=>"l2vpns"}
                 PUT    /l2vpns/:id(.:format)                  {:action=>"update", :controller=>"l2vpns"}
                 DELETE /l2vpns/:id(.:format)                  {:action=>"destroy", :controller=>"l2vpns"}
      home_index GET    /home/index(.:format)                  {:controller=>"home", :action=>"index"}
                        /:controller(/:action(/:id(.:format))) 
            root        /                                      {:controller=>"home", :action=>"index"}
[root@localhost pocplus]# 

Anyone can tell me what am I doing wrong? Why does the button take to the “edit” page and not the /home/index one?

If this info is important, I’m using Firefox 11.0

  • 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-31T18:30:47+00:00Added an answer on May 31, 2026 at 6:30 pm

    Try rewriting your button as

    <form><a href=/home/index><button type="button">Main Menu</button></a></form>
    

    The default type for a button in most browsers is “submit”, so it’s trying to submit your form.

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

Sidebar

Related Questions

In my ruby on rails app I am trying to use a Prototype Form.Element.Observer
I have a simple Ruby on Rails form which includes an authenticity_token. Unfortunatly, I
I'm trying to make a non-model form in ruby on rails, most of the
I am new to Ruby on Rails. I am trying to create a form
I'm currently trying to add widgEditor to a form in ruby on rails however
I have a ruby-on-rails application, which shows a modal dialog form for first-time users.
I have a large Ruby on Rails form that has the following partial view
I have a complex form in Ruby on Rails 2.3.5, here's the structure for
this time it's about Ruby On Rails. I have a form in the view
Has anyone used Ruby/Rails with a Sales Logix database?

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.