Added new Rails controller using "generate controller" but can't load page -


i have rails app has consisted of backend code far (a little custom workflow engine, redis, foreman, etc). today tried add first controller application, can't new controller load.

i used:

rails generate controller collecteddata new --no-test-framework 

and got back:

  create  app/controllers/collected_data_controller.rb    route  "collected_data/new"   invoke  erb   create    app/views/collected_data   create    app/views/collected_data/new.html.erb   invoke  helper   create    app/helpers/collected_data_helper.rb   invoke  assets   invoke    coffee   create      app/assets/javascripts/collected_data.js.coffee   invoke    scss   create      app/assets/stylesheets/collected_data.css.scss 

and ran rake routes , got this:

collected_data_new /collected_data/new(.:format) collected_data#new 

but whenever load http://localhost:3000/collected_data/new in browser, get:

not found: /collected_data/new 

here content of routes.rb file:

crows::application.routes.draw   "collected_data/new"    # priority based upon order of creation:   # first created -> highest priority.    # sample of regular route:   #   match 'products/:id' => 'catalog#view'   # keep in mind can assign values other :controller , :action    # sample of named route:   #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase   # route can invoked purchase_url(:id => product.id)    # sample resource route (maps http verbs controller actions automatically):   #   resources :products    # sample resource route options:   #   resources :products   #     member   #       'short'   #       post 'toggle'   #     end   #   #     collection   #       'sold'   #     end   #   end    # sample resource route sub-resources:   #   resources :products   #     resources :comments, :sales   #     resource :seller   #   end    # sample resource route more complex sub-resources   #   resources :products   #     resources :comments   #     resources :sales   #       'recent', :on => :collection   #     end   #   end    # sample resource route within namespace:   #   namespace :admin   #     # directs /admin/products/* admin::productscontroller   #     # (app/controllers/admin/products_controller.rb)   #     resources :products   #   end    # can have root of site routed "root"   # remember delete public/index.html.   # root :to => 'welcome#index'    # see how routes lay out "rake routes"    # legacy wild controller route that's not recommended restful applications.   # note: route make actions in every controller accessible via requests.   # match ':controller(/:action(/:id))(.:format)' end 

procfile contents:

redis: redis-server config/redis/redis.conf clock: bundle exec rake resque:scheduler --trace cp_resp_poller: bundle exec rake environment resque:work queue=cp_resp_poller cp_req_sender: bundle exec rake environment resque:work queue=cp_req_sender --trace server: rails server 

i have tried restarting webrick.

update: noticed webrick returning http 404 when requesting controller (or new controller i've tried add, matter).

fixed: please see own answer question.

fixed: fixed changing config.ru file.

the original contents were:

require ::file.expand_path('../config/environment',  __file__) run crows::application  require 'resque/server' run rack::urlmap.new "/resque" => resque::server.new 

i fixed controller not found issue commenting out last 2 lines above related resque. last 2 lines added on while developing workflow/backend part of application , enable web-based admin interface resque.

update: have rails app (plus web controllers, etc) , resque web admin interface running side-by-side. got working removing last 2 lines config.ru file , adding following lines routes.rb file:

resources :resque_web_admin mount resque::server, :at => "/resque" 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -