没有路线匹配[POST]" /index.html" Rails 4设计

时间:2015-01-05 14:29:52

标签: ruby-on-rails-4 devise

您好我的路线问题我在访问我的网址时使用了设计

http://localhost:3000/users/sign_in

我尝试注册时遇到问题或登录时显示以下错误

没有路线匹配[POST]“/index.html”

这是我的文件route.rb

 MesaAyuda::Application.routes.draw do


  #para combo subcategoria en subfamilia incidencia
  get 'fam_subcat_incidencias/:id/edit_subcategoria_incidencias' => 'fam_subcat_incidencias#update_subcategoria_incidencias', as: 'edit_subcategoria_incidencias'
  get 'fam_subcat_incidencias/update_subcategoria_incidencias' => 'fam_subcat_incidencias#update_subcategoria_incidencias', as: 'update_subcategoria_incidencias'

  resources :operarios

  resources :fam_subcat_incidencias


  devise_for :users
  resources :perfiles

  resources :nivel_accesos

  resources :subcategoria_incidencias 


  resources :categoria_incidencias

  resources :ubicaciones

  resources :categorias

  root :to => 'categorias#index'



  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"
  # root 'welcome#index'

  # Example of regular route:
  #   get 'products/:id' => 'catalog#view'

  # Example of named route that can be invoked with purchase_url(id: product.id)
  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

  # Example resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Example resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Example resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Example resource route with more complex sub-resources:
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', on: :collection
  #     end
  #   end

  # Example resource route with concerns:
  #   concern :toggleable do
  #     post 'toggle'
  #   end
  #   resources :posts, concerns: :toggleable
  #   resources :photos, concerns: :toggleable

  # Example resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end
end

这是我的模特用户

    class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
        :recoverable, :rememberable, :trackable, :validatable
  belongs_to :perfil       
end

现在查看登录表单的源代码或操作日志指向../../ index.html。

因为出现这种情况?我做错了请帮帮我,我疯了

<form action="../../index.html" method="post">
                <div class="body bg-gray">

                    <h2>Sign in</h2>

1 个答案:

答案 0 :(得分:0)

从我的角度来看你必须创建控制器类别并在那个控制器中定义索引方法并检查它,它可能是工作