路线不正确?删除适用于Firefox但不适用于Internet Explorer

时间:2011-01-27 03:48:10

标签: internet-explorer ruby-on-rails-3 routes

我遇到的问题是,在IE-7中调用的任何“删除”操作都会转到“show”而不是执行destroy。 'logout'最终会尝试同样的东西但失败,因为account_session没有'show'动作。有趣的是,Firefox-3.6.x中的一切正常。我正在使用Authlogic进行身份验证,但不认为这很重要。

有人能发现我的路线有问题吗?或者知道为什么IE不喜欢它们?

的routes.rb

resource :account_session
root :controller => "account_sessions", :action => "new" # optional, this just sets the root route

resources :accounts
resource :account, :controller => "accounts"

resource :password_resets, :controller => "password_resets" #, :only => [:new, :edit]
resources :password_resets

resources :students
resources :departments

resources :exhibitions, :only => [:destroy, :update]
resources :projects do
  resources :exhibitions, :only => [:create, :edit, :index, :new, :show]
end

resources :tags

resources :medias, :only => [:destroy, :update, :create, :edit, :new, :show]
resources :projects do
  resources :medias, :only => [:create, :edit, :index, :new, :show, :update]
end

controller :advanced_search do
  get 'search' => :new
  get 'search_results' => :index
  post 'search_results' => :index
end

get "activate" => 'activations#create'
get "password_reset" => 'password_resets#edit'

get "profile" => 'students#show'

controller :admin do
  get 'admin' => :index
  post 'admin/profile' => :update
end

resources :students do
  resources :projects do
    get :unlink, :on => :member
  end
end

resources :tags do
  resources :projects do
    get :untag, :on => :member
  end
end

get "" => 'accounts#new'

controller :account_sessions do
  delete 'logout' => :destroy
end

get "register" => 'accounts#new'

match '/pages', :to => 'pages#show'

root :to => "accounts#new"

1 个答案:

答案 0 :(得分:2)

如果您的问题是特定于浏览器的,我强烈怀疑您的routes.rb文件是否有任何问题。

这些问题可能是由您的观点JavaScript引起的。实际上,听起来似乎JavaScript在IE中根本没有执行,这导致您的链接被跟踪。