Hallo,
ich habe im controller eine ziemlich einfache Methode:
def update
@holding = Holding.find(params[:id])
load_lists
if @holding.update_attributes(params[:holding])
flash[:notice] = 'Bestand erfolgreich aktualisiert.'
redirect_to :action => 'show', :id => @holding
else
render :action => 'edit'
end
end
jedoch funktioniert sie nicht. es greift immer der else Fall, d.h. das die
Edit-Maske wird nicht gerendert. (Ein Fehler in der Validierung müsste
demnach vorliegen)
Aber:
- Es gibt keine Validierungsanweisungen im model
- Ersetze ich update_attributes durch update_attributes! wird das Objekt
gespeichert - jedoch würde ich gerne später benutzerfreundlich validieren.
- <%= error_messages_for 'holding' %> gibt nichts aus
- Das log sieht absolut "sauber" aus - kein SQL Fehler. (siehe unten).
Was läuft hier verkehrt?
Danke,
Alles Gute
Jan
Processing HoldingsController#update (for 127.0.0.1 at 2007-11-25 13:14:11)
[POST]
Session ID: 77e6c99dc50b7785e4f7dd80fbc18bd1
Parameters: {"commit"=>"Speichern", "minimum_count"=>{"size4"=>""}, [.. sehr
viel...]
Holding Columns (0.001960) SHOW FIELDS FROM holdings
Holding Load (0.000913) SELECT * FROM holdings WHERE (holdings.`id` = 1)
StatusType Load (0.000443) SELECT * FROM status_types ORDER BY name
StatusType Columns (0.001147) SHOW FIELDS FROM status_types
StorageLocation Load (0.000742) SELECT * FROM storage_locations ORDER BY
place
StorageLocation Columns (0.001152) SHOW FIELDS FROM storage_locations
Rendering actioneditlayoutfalse within layouts/application
Rendering holdings/edit
Rendered holdings/_form (0.00479)
Completed in 0.04020 (24 reqs/sec) | Rendering: 0.01059 (26%) | DB: 0.00636
(15%) | 200 OK [http://localhost/holdings/update/1]
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug