Redirect_to doesn't work for create action

Hi,

I am trying to use redirect_to in one of my action in a controller class

I want it to redirect to another controller create action which is a
HTTP POST method, I tried different option but none of them seems to
work.

Here is my code

class HomesController < ApplicationController
def login
redirect_to sessionmanagers_path(:method=>:post)
end
end

my routes.rb has the following

map.resource :sessionmanagers
map.resources :homes

The other way that i tried is

redirect_to sessionmanagers_path(:method=>:post)
redirect_to sessionmanagers_path, :method=>:post
redirect_to sessionmanagers_path, :method=>“post”

I am expecting it to go the Sessionmanagers controller and create action

When I do rake routes i get the following

new_sessionmanagers GET /sessionmanagers/new(.:format)
{:controller=>“sessionmanagers”, :action=>“new”}
edit_sessionmanagers GET /sessionmanagers/edit(.:format)
{:controller=>“sessionmanagers”, :action=>“edit”}
sessionmanagers GET /sessionmanagers(.:format)
{:controller=>“sessionmanagers”, :action=>“show”}
PUT /sessionmanagers(.:format)
{:controller=>“sessionmanagers”, :action=>“update”}
DELETE /sessionmanagers(.:format)
{:controller=>“sessionmanagers”, :action=>“destroy”}
POST /sessionmanagers(.:format)
{:controller=>“sessionmanagers”, :action=>“create”}

Any help is appreciated.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs