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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:30:05+00:00 2026-06-15T02:30:05+00:00

I get the following error No route matches [POST] "/events" with this setup: config/routes.rb

  • 0

I get the following error

No route matches [POST] "/events"

with this setup:

config/routes.rb

namespace :admin do
  #...
  resources :events
  #...
end

(…)admin/events_controller.rb

class Admin::EventsController < Admin::AdminController
  def index
    @events = Event.all
  end

  def new
    @event = Event.new
  end

  def create
    @event = Event.new(params[:event])

    if @event.save
      redirect_to [:admin, admin_events_url]
    else
      render :action => "new"
    end
  end

  def edit
    @event = Event.find(params[:id])
  end
end

(…)admin/events/_form.html.erb

<%= form_for([:admin, @event]) do |f| %>

I can’t figure out what I am doing wrong!

Update

I get this error when I try to POST the from data while creating a new event entry


Update 2

The opening form tag inside events/new:

<form accept-charset="UTF-8" action="/admin/events" enctype="multipart/form-data" id="new_event" method="post">

the result of rake routes:

 admin_events GET    /admin/events(.:format)             admin/events#index
              POST   /admin/events(.:format)             admin/events#create

Navigating to /admin/events/ using GET works just fine.


Update 3

It works fine on Windows 8 x64 bit with Ruby 1.9.3, Rails 3.2 and Mongrel. It doesn’t work with Ruby 1.8.7, Rails 3.2 and Phusion Passenger on a linux server (the host).

Update 4

Oh. It appears Rails isn’t very happy if you send it a form with multipart/form-data encoding! Removing the file-upload fixed this issue.

  • 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-15T02:30:06+00:00Added an answer on June 15, 2026 at 2:30 am

    For what it’s worth the only thing that looks fishy to me about your controller is your redirect. You should be able to just do:

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

Sidebar

Related Questions

I'm getting the following error when loading this URL: localhost:3000/groups/5/post/new No route matches [GET]
I'm having an issue with Rails, I get the following error: No route matches
During cucumber tests, I get the following error: No route matches /companies/29/update_owner I am
I am using the code as described in this question. However get following error
Here is my actual error: No route matches [GET] /members/sign_out Since most people will
Using Rails 3.0.3. I have the following route in routes.rb: match user/create_new_password/:reset_password_key =>users#create_new_password, :via=>[:get,
I have the following route in routes.rb : map.resources 'protégés', :controller => 'Proteges', :only
I have the following routes in my 3.1.0.rc5 app # config/routes.rb devise_for :users resources
I get following error (SyntaxError): missing ] after element list when using eval function.
I get following error message, when I try to run git rebase -i for

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.