Note that there are some explanatory texts on larger screens.

plurals
  1. PORails object will not be created
    primarykey
    data
    text
    <p>Ruby 1.8.7, Rails 2.3.11</p> <p>Main question: what could cause Rails to send me the index page for an object type after trying to create a new object of that type? No errors produced, no success message, no new entries in the database</p> <p>I used <code>ruby script/generate scaffold poster owner_id:integer event_id:integer</code> to create a standard scaffold, then ran <code>rake db:migrate</code>. Without changing any files, I tried to create a new poster object, and it sent me to /posters rather than /posters/show/1, as it's supposed to do.</p> <p><strong>Other information which may be of help:</strong></p> <p>There are other object types already in place on the server. This problem originally cropped up when I was trying to have the poster belong_to :owner and belong_to :event.</p> <p>If the information was getting to the model to be validated, it would return an error blank required entries. If I enter the data manually into the MySQL database, it shows up in the index page, and can be edited (and saved) without issue. Because of that, I think that the issue is either in the controller file or the database itself, but nothing raised a red flag when I looked through.</p> <p>I have minimal (4 weeks of a class) experience with Rails, and have been stuck on this for three days now.</p> <p><strong>routes.rb:</strong> (commented lines stripped)</p> <pre><code>ActionController::Routing::Routes.draw do |map| map.resources :posters map.resources :place_informations map.resources :building_polygon_coordinates map.resources :alternate_names map.resources :events map.resources :hours_listings map.resources :locations map.connect 'json/buildings', :controller =&gt; 'json', :action =&gt; 'buildings' map.resources :users map.resources :buildings map.root :controller =&gt; "home" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end </code></pre> <p><strong>Applicable part of development.log:</strong> (the very end; just the attempt to create a new poster; SQL calls stripped out)</p> <pre><code>Processing PostersController#index (for &lt;my IP address&gt; at 2011-05-26 20:32:44) [GET] ~~ SQL stuff, call timings ~~~ Rendering template within layouts/posters Rendering posters/index ~~ SQL stuff, call timings ~~~ Processing PostersController#new (for &lt;my IP address&gt; at 2011-05-26 20:32:48) [GET] ~~ SQL stuff, call timings ~~~ Rendering template within layouts/posters Rendering posters/new ~~ SQL stuff, call timings ~~~ Processing PostersController#index (for &lt;my IP address&gt; at 2011-05-26 20:32:56) [GET] ~~ SQL stuff, call timings ~~~ Rendering template within layouts/posters Rendering posters/index ~~ SQL stuff, call timings ~~~ </code></pre> <p>It <em>is</em> "get index, get new, get index"<br> It should be* "get index, get new, post create, get show, get index"</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