我的文件夾結構如下: 根/ home3 /用戶名軌文件routes.rb中的語法問題
我的web應用程序正在rails_apps/my_app應用/所以我的意見是下rails_apps/my_app應用/應用/視圖
[email protected] [~]# ls -la rails_apps/my_app/app/views/
total 24
drwxr-xr-x 6 username username 4096 Sep 17 00:48 ./
drwxr-xr-x 8 username username 4096 Sep 13 23:13 ../
drwxr-xr-x 2 username username 4096 Sep 17 01:51 home/
drwxr-xr-x 2 username username 4096 Sep 15 08:47 layouts/
drwxr-xr-x 2 username username 4096 Sep 17 00:00 projects/
drwxr-xr-x 2 username username 4096 Sep 17 00:49 scenarios/
[email protected] [~]# ls -la rails_apps/my_app/app/views/home/
total 16
drwxr-xr-x 2 username username 4096 Sep 17 01:51 ./
drwxr-xr-x 6 username username 4096 Sep 17 00:48 ../
-rw-r--r-- 1 username username 311 Sep 17 00:14 index.html.erb
[email protected] [~]#
[email protected] [~]# cat rails_apps/my_app/app/views/home/index.html.erb
<center><h1>my_app</h1></center>
<html>
<head>
</head>
<body>
<form action = "/projects">
<br>
<input type="submit" value="Manage Projects" />
</form>
<form action = "/scenarios">
<br>
<input type="submit" value="Manage Scenarios" />
</form>
</body>
</html>
[email protected] [~]#
這是我rails_apps/my_app應用/配置/ routes.rb中文件
My_app::Application.routes.draw do
resources :scenarios
resources :projects do
collection do
get :update_fields
get :annual_production
end
end
get "home/index"
match ':controller(/:action(/:id(.:format)))'
root :to => 'home#index'
end
有了這個,我的web應用程序顯示文件rails_apps的內容/ my_app應用/應用/視圖/家/index.html.erb正確的,但是當我點擊按鈕「管理項目」,它生成此錯誤
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected]_app.company.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at my_app.company.com Port 80
我相信這是一個路由的問題,因爲我有另外一個web應用程序,這是非常相似,這一個,除了它直接在root下,這個是在rails_apps文件夾下,但我似乎無法修復它。
有人可以幫忙嗎?
謝謝亞當。你希望我發佈什麼配置? – rh4games
你能發佈這個網站的Apache配置嗎? –
嗨,亞當,我試圖將我的應用程序,我的Mac上運行良好,到一個由商業託管服務提供商託管的Linux服務器;我無法訪問他們的Apache配置,但是在幫助我解決許多其他問題之後,他們的支持說,現在這是一個必須在我身邊解決的路由問題。 – rh4games