PecanProject / bety

Web-interface to the Biofuel Ecophysiological Traits and Yields Database (used by PEcAn and TERRA REF)
https://www.betydb.org
BSD 3-Clause "New" or "Revised" License
16 stars 38 forks source link

model/<id>edit and modeltypes/<id>/edit links are broken #292

Closed dlebauer closed 9 years ago

dlebauer commented 9 years ago

When I try to edit a model, it gives a 500 Internal error.

Specifically, going to https://www.betydb.org/models/7/edit

puts this in the log:

Started GET "/models/7/edit" for 128.174.125.237 at 2015-05-14 16:28:20 -0500
Processing by ModelsController#edit as HTML
  Parameters: {"id"=>"7"}
********************************************************************************
args = []; block = 
  Rendered models/_edit_models_files.html.erb (1.6ms)
  Rendered models/edit.html.erb within layouts/application (2.0ms)
Completed 500 Internal Server Error in 6.8ms

ActionController::RoutingError (No route matches {:controller=>"models", :action=>"edit_models_files", :id=>7}):
  app/views/models/_edit_models_files.html.erb:6:in `_app_views_models__edit_models_files_html_erb___1186838639634320369_164949300'
  app/views/models/edit.html.erb:11:in `_app_views_models_edit_html_erb__1565926412534003971_165017100'
  app/controllers/application_controller.rb:159:in `render'

Similarly, navigating to https://www.betydb.org/modeltypes/2/edit gives:

Started GET "/modeltypes/2/edit" for 128.174.125.237 at 2015-05-14 16:35:09 -0500
Processing by ModeltypesController#edit as HTML
  Parameters: {"id"=>"2"}
********************************************************************************
args = []; block = 
  Rendered modeltypes/_edit_formats.html.erb (3.0ms)
  Rendered modeltypes/edit.html.erb within layouts/application (3.4ms)
Completed 500 Internal Server Error in 9.0ms

ActionController::RoutingError (No route matches {:controller=>"modeltypes", :action=>"add_modeltypes_format"}):
  app/views/modeltypes/_edit_formats.html.erb:38:in `_app_views_modeltypes__edit_formats_html_erb__2960624872103525086_136117680'
  app/views/modeltypes/edit.html.erb:11:in `_app_views_modeltypes_edit_html_erb___20957359431865159_136150880'
  app/controllers/application_controller.rb:159:in `render'
robkooper commented 9 years ago

Not sure what happened, this used to work.I think i saw something about routes being changed?

gsrohde commented 9 years ago

I'm pretty sure I fixed this but haven't deployed yet, or maybe this is one broken route I neglected. I'll try to get to this ASAP.

gsrohde commented 9 years ago

@dlebauer You should now be able to edit the collection of files associated with a model and the collection of formats associated with a modeltype. Let me know if there are any remaining issues, otherwise close this.

mdietze commented 9 years ago

This is still broken on psql-pecan.bu.edu and on the pecan vm (current 1.4.2). It appears to work on betydb.org, but within modeltype the links to related Models and Pfts have disappeard.

gsrohde commented 9 years ago

On the "show" pages, there are links to related Pfts, Models, and Formats (see for example https://www.betydb.org/modeltypes/1). On the "edit" pages, only the Formats are shown. As far as I can tell, it has always been this way, but Rob is more familiar with this code.