开发者

Incorrect routes? Delete works in Firefox but not Internet Explorer

开发者 https://www.devze.com 2023-02-07 12:02 出处:网络
The problem I\'m having is that any \'delete\' action that gets called in IE-7 goes to the \'show\' instead of performing the destroy. The \'logout\' ends up trying the samething but fails as there is

The problem I'm having is that any 'delete' action that gets called in IE-7 goes to the 'show' instead of performing the destroy. The 'logout' ends up trying the samething but fails as there is no 'show' action for account_session. The funny thing is that everything works fine in Firefox-3.6.x. I'm using Authlogic for authentication, but don't think that matters.

Can anyone spot a problem with my routes? or know why IE doesn't like them?

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

g开发者_如何学Goet "register" => 'accounts#new'

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

root :to => "accounts#new"


If your issues are browser-specific, I strongly doubt there is anything wrong with your routes.rb file.

The issues are probably being caused by your views' JavaScript. In fact, it sounds as though the JavaScript isn't executing at all in IE, which results in your links being followed instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消