Reputation: 267020
My routes.rb has the following:
namespace :admin do
root 'dashboard#index'
resources :users
end
I don't see a prefix for the admin/users#create path for some reason?
rake routes shows:
POST /admin/users(.:format) admin/users#create
I thought it would be:
admin_incidents_create POST /admin/incidents(.:format) admin/incidents#create
Because of this, I can't create my form tag correctly:
<%= form_for @user, url: ??? do |f| %>
Why isn't the create_path prefix appearing in my rake routes?
Upvotes: 0
Views: 324
Reputation: 373
Try to use namespace
in form_for, like this
<%= form_for([:admin, @user]) do |f| %>
...
<% end %>
please see this for more detail: here
Upvotes: 2