Note that there are some explanatory texts on larger screens.

plurals
  1. POAdded new Rails controller using "generate controller" but can't load page
    primarykey
    data
    text
    <p>I have a Rails app that has only consisted of backend code so far (a little custom workflow engine, Redis, foreman, etc). Today I tried to add the first controller to the application, but I can't get the new controller to load.</p> <p>I used:</p> <pre><code>rails generate controller CollectedData new --no-test-framework </code></pre> <p>And got back:</p> <pre><code> create app/controllers/collected_data_controller.rb route get "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 </code></pre> <p>And I also ran <code>rake routes</code> and got this:</p> <pre><code>collected_data_new GET /collected_data/new(.:format) collected_data#new </code></pre> <p>But whenever I load <code>http://localhost:3000/collected_data/new</code> in my browser, I get:</p> <pre><code>Not Found: /collected_data/new </code></pre> <p>Here is the content of my routes.rb file:</p> <pre><code>Crows::Application.routes.draw do get "collected_data/new" # The priority is based upon order of creation: # first created -&gt; highest priority. # Sample of regular route: # match 'products/:id' =&gt; 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' =&gt; 'catalog#purchase', :as =&gt; :purchase # This route can be invoked with purchase_url(:id =&gt; product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on =&gt; :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to =&gt; 'welcome#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)' end </code></pre> <p>Procfile contents:</p> <pre><code>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 </code></pre> <p>I have also tried restarting WEBrick.</p> <p>Update: I noticed that Webrick is returning HTTP 404 when requesting this controller (or any new controller that I've tried to add, for that matter).</p> <p>FIXED: Please see my own answer to this question.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload