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

  • Home
  • SEARCH
  • 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 8182111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:44:46+00:00 2026-06-07T00:44:46+00:00

# Explaining the context puts I am learning Rails, building a simple forum application.

  • 0

# Explaining the context

puts "I am learning Rails, building a simple forum application."
puts "I am pretty satisfied to where I got so far but routes... "
puts "...still figuring them out."
puts "Been 2 days trying all sorts of things."
puts "This is where I am now, and something is not working as expected."
puts "Any help/pointers would be appreciated! :)"

# The Problem

puts "I want my forum's create path to be '/helpcenter' and not '/helpcenter/cat'."
puts "When I access the form to create a new forum and I hit submit, "
puts "the form post to '/helpcenter' correctly (firebuged)"
puts "but I get the index, not the create!"
puts "I even put debugger in my create action but it is not being called."

# config/routes.rb

scope "/helpcenter" do
  resources :cat, :controller => "forums", :as => :forums do
    resources :topics , :controller => "forum_topics", :as => :topics
    resources :posts, :controller => "forum_posts", :as => :posts
  end
end

match "/helpcenter" => "forums#index", :as => :forums
match "/helpcenter" => "forums#create", :via => :post, :as => :create_forum

I hope this problem is in the way I created the route. I tried many different things.

# _form.html.erb

<%= form_for(@forum) do |f| %>
....
<% end %>

I am using standard form_for helper.

# Rake Routes for Forums

$ CONTROLLER=forums rake routes
delete_forum GET    /helpcenter/cat/:id/delete(.:format) forums#delete
      forums GET    /helpcenter/cat(.:format)            forums#index
             POST   /helpcenter/cat(.:format)            forums#create
   new_forum GET    /helpcenter/cat/new(.:format)        forums#new
  edit_forum GET    /helpcenter/cat/:id/edit(.:format)   forums#edit
       forum GET    /helpcenter/cat/:id(.:format)        forums#show
             PUT    /helpcenter/cat/:id(.:format)        forums#update
             DELETE /helpcenter/cat/:id(.:format)        forums#destroy
      forums        /helpcenter(.:format)                forums#index
create_forum POST   /helpcenter(.:format)                forums#create

We clearly see a route for POST /helpcenter which is binded to the create action of the forums controller.

# Logs

Started POST "/helpcenter" for 127.0.0.1 at 2012-07-02 12:25:00 -0400
Processing by ForumsController#index as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"d5iVKCh234234=", "forum"=>{"name"=>"", "description"=>""}, "commit"=>"Save Changes"}

The logs clearly shows I am doing a POST on /helpcenter but that it fires up the index action instead of the create action!

# What am I doing wrong?

puts "Thanks!"
  • 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-07T00:44:48+00:00Added an answer on June 7, 2026 at 12:44 am

    I think the request matches your first forums route since you didn’t specify a HTTP method. This should work:

    match "/helpcenter" => "forums#index", :via => :get, :as => :forums
    match "/helpcenter" => "forums#create", :via => :post, :as => :create_forum
    

    Or the shorthand version:

    get "/helpcenter" => "forums#index", :as => :forums
    post "/helpcenter" => "forums#create", :as => :create_forum
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

# Explaining the context puts I am learning Rails, building a simple forum application.
I am having trouble explaining this to myself but here is my best attempt.
Recently while I was explaining the basic difference between pointers and references(in context of
In a Rails application, I need a table in my database to contain constant
I'm building my application with Entity Framework (model first principle). I'm also using MS
I'm not very good at explaining in english but i'll give it a go.
I first got an error usign the code below, explaining that DataGridLinkButton' must be
The Context: It appears that the simple scjp ->scja->.... tracks for sun certification have
The question is self-explaining, how to create a tearoff menu using GTKAda? I can't
I need help explaining to my boss why her design is poor on 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.