ruby - Why are these routes missing from rake routes? -
rails 3.2.13
i trying follow deployment using screencast: http://railscasts.com/episodes/335-deploying-to-a-vps
i have app works in development when pushed production capistrano 1 of controllers actions result in 404 pages.
when run 'rake routes' notice controller's actions missing output:
routes.rb
wagmantechnology::application.routes.draw root :to => 'static_pages#home' resources :users resources :sessions, only: [:new, :create, :destroy] resources :tasks resources :assets match '/signup', to: 'users#new' match '/signin', to: 'sessions#new' match '/signout', to: 'sessions#destroy', via: :delete match 'tasks/mjhartman' => "tasks#mjhartman", :as => "tasks_mjhartman" match 'tasks/ejmcfadden' => "tasks#ejmcfadden", :as => "tasks_ejmcfadden" match 'tasks/ctkahler' => "tasks#ctkahler", :as => "tasks_ctkahler" match 'tasks/gafc' => "tasks#gafc", :as => "tasks_gafc" match 'tasks/wci' => "tasks#wci", :as => "tasks_wci" match 'tasks/fsc' => "tasks#fsc", :as => "tasks_fsc" match 'tasks/wagco' => "tasks#wagco", :as => "tasks_wagco" match 'tasks/it' => "tasks#it", :as => "tasks_it" match 'tasks/atf' => "tasks#atf", :as => "tasks_atf" match 'tasks/hr' => "tasks#hr", :as => "tasks_hr" match 'tasks/legal' => "tasks#legal", :as => "tasks_legal" match 'tasks/marketing' => "tasks#marketing", :as => "tasks_marketing" match 'tasks/user_request' => "tasks#user_request", :as => "tasks_user_request" match 'tasks/jde' => "tasks#jde", :as => "tasks_jde" match 'tasks/communications' => "tasks#communications", :as => "tasks_communications" match 'tasks/hardware' => "tasks#hardware", :as => "tasks_hardware" match 'tasks/software' => "tasks#software", :as => "tasks_software" match 'tasks/documentation' => "tasks#documentation", :as => "tasks_documentation" match 'tasks/security' => "tasks#security", :as => "tasks_security" match 'tasks/billing' => "tasks#billing", :as => "tasks_billing" match 'tasks/training' => "tasks#training", :as => "tasks_training" match 'tasks/york_gafc' => "tasks#york_gafc", :as => "tasks_york_gafc" match 'tasks/york_wci' => "tasks#york_wci", :as => "tasks_york_wci" match 'tasks/berryville' => "tasks#berryville", :as => "tasks_berryville" match 'tasks/route52' => "tasks#route52", :as => "tasks_route52" match 'tasks/gafc_field' => "tasks#gafc_field", :as => "tasks_gafc_field" match 'tasks/wci_field' => "tasks#wci_field", :as => "tasks_wci_field" match 'assets/laptop' => "assets#laptop", :as => "assets_laptop" match 'assets/desktop' => "assets#desktop", :as => "assets_desktop" match 'assets/server' => "assets#server", :as => "assets_server" match 'assets/network' => "assets#network", :as => "assets_network" match 'assets/tablet' => "assets#tablet", :as => "assets_tablet" match 'assets/cell' => "assets#cell", :as => "assets_cell" match 'assets/data' => "assets#data", :as => "assets_data" match 'assets/office' => "assets#office", :as => "assets_office" match 'assets/printer' => "assets#printer", :as => "assets_printer" match 'assets/gafc' => "assets#gafc", :as => "assets_gafc" match 'assets/wci' => "assets#wci", :as => "assets_wci" match 'assets/fsc' => "assets#fsc", :as => "assets_fsc" match 'assets/wagco' => "assets#wagco", :as => "assets_wagco" match 'assets/it' => "assets#it", :as => "assets_it" match 'assets/atf' => "assets#atf", :as => "assets_atf" match 'assets/hr' => "assets#hr", :as => "assets_hr" match 'assets/legal' => "assets#legal", :as => "assets_legal" match 'assets/marketing' => "assets#marketing", :as => "assets_marketing" match 'assets/user_request' => "assets#user_request", :as => "assets_user_request" match 'assets/jde' => "assets#jde", :as => "assets_jde" match 'assets/communications' => "assets#communications", :as => "assets_communications" match 'assets/hardware' => "assets#hardware", :as => "assets_hardware" match 'assets/software' => "assets#software", :as => "assets_software" match 'assets/documentation' => "assets#documentation", :as => "assets_documentation" match 'assets/security' => "assets#security", :as => "assets_security" match 'assets/billing' => "assets#billing", :as => "assets_billing" match 'assets/training' => "assets#training", :as => "assets_training" match 'assets/york_gafc' => "assets#york_gafc", :as => "assets_york_gafc" match 'assets/york_wci' => "assets#york_wci", :as => "assets_york_wci" match 'assets/berryville' => "assets#berryville", :as => "assets_berryville" match 'assets/route52' => "assets#route52", :as => "assets_route52" match 'assets/gafc_field' => "assets#gafc_field", :as => "assets_gafc_field" match 'assets/wci_field' => "assets#wci_field", :as => "assets_wci_field" match 'assets/inventory' => "assets#inventory", :as => "assets_inventory" end
the output 'rake routes':
root / static_pages#home users /users(.:format) users#index post /users(.:format) users#create new_user /users/new(.:format) users#new edit_user /users/:id/edit(.:format) users#edit user /users/:id(.:format) users#show put /users/:id(.:format) users#update delete /users/:id(.:format) users#destroy sessions post /sessions(.:format) sessions#create new_session /sessions/new(.:format) sessions#new session delete /sessions/:id(.:format) sessions#destroy tasks /tasks(.:format) tasks#index post /tasks(.:format) tasks#create new_task /tasks/new(.:format) tasks#new edit_task /tasks/:id/edit(.:format) tasks#edit task /tasks/:id(.:format) tasks#show put /tasks/:id(.:format) tasks#update delete /tasks/:id(.:format) tasks#destroy signup /signup(.:format) users#new signin /signin(.:format) sessions#new signout delete /signout(.:format) sessions#destroy tasks_mjhartman /tasks/mjhartman(.:format) tasks#mjhartman tasks_ejmcfadden /tasks/ejmcfadden(.:format) tasks#ejmcfadden tasks_ctkahler /tasks/ctkahler(.:format) tasks#ctkahler tasks_gafc /tasks/gafc(.:format) tasks#gafc tasks_wci /tasks/wci(.:format) tasks#wci tasks_fsc /tasks/fsc(.:format) tasks#fsc tasks_wagco /tasks/wagco(.:format) tasks#wagco tasks_it /tasks/it(.:format) tasks#it tasks_atf /tasks/atf(.:format) tasks#atf tasks_hr /tasks/hr(.:format) tasks#hr tasks_legal /tasks/legal(.:format) tasks#legal tasks_marketing /tasks/marketing(.:format) tasks#marketing tasks_user_request /tasks/user_request(.:format) tasks#user_request tasks_jde /tasks/jde(.:format) tasks#jde tasks_communications /tasks/communications(.:format) tasks#communications tasks_hardware /tasks/hardware(.:format) tasks#hardware tasks_software /tasks/software(.:format) tasks#software tasks_documentation /tasks/documentation(.:format) tasks#documentation tasks_security /tasks/security(.:format) tasks#security tasks_billing /tasks/billing(.:format) tasks#billing tasks_training /tasks/training(.:format) tasks#training tasks_york_gafc /tasks/york_gafc(.:format) tasks#york_gafc tasks_york_wci /tasks/york_wci(.:format) tasks#york_wci tasks_berryville /tasks/berryville(.:format) tasks#berryville tasks_route52 /tasks/route52(.:format) tasks#route52 tasks_gafc_field /tasks/gafc_field(.:format) tasks#gafc_field tasks_wci_field /tasks/wci_field(.:format) tasks#wci_field
you'll see none of asset routes listed. why? strangely enough index action /assets works in production nothing else. links work in development. doing wrong here?
the reason should name conflict assets pipeline.
the word "assets" in routing sensitive, it's same rails static assets. can verify localhost:3000/assets/rails.png
work in development env, not production. of "assets" routes have been changed in production mode.
my suggestion rename route namespace "assets" else. may involve lots of work. don't know other simpler way yet.
update @sevenseacat's comment. pointed out simpler way - change assets routes
config.assets.prefix = "/some_other_path"
ref: assets-path">http://guides.rubyonrails.org/asset_pipeline.html#changing-the-assets-path
Comments
Post a Comment