espen / balder

Balder - Open source Ruby on Rails photo gallery
http://balderapp.com
MIT License
262 stars 97 forks source link

NoMethodError (undefined method `parameterize' for nil:NilClass) when searching #45

Closed abort closed 10 years ago

abort commented 10 years ago

I have uploaded the app to heroku using the instructions etc (using the newer method of setting variables through the heroku command line rather than the config file). Upload and browsing works fine. As soon as I try to search I get the following error in my log (the same happens locally):

2014-03-07T11:10:58.716249+00:00 app[web.1]: Completed 500 Internal Server Error in 219ms 2014-03-07T11:10:58.717986+00:00 app[web.1]: 2014-03-07T11:10:58.717986+00:00 app[web.1]: NoMethodError (undefined methodparameterize' for nil:NilClass): 2014-03-07T11:10:58.717986+00:00 app[web.1]: app/models/album.rb:25:in ensure_path' 2014-03-07T11:10:58.717986+00:00 app[web.1]: app/controllers/albums_controller.rb:58:increate' 2014-03-07T11:10:58.717986+00:00 app[web.1]: app/middleware/flash_session_cookie_middleware.rb:16:in call'

espen commented 10 years ago

What are the params made to search?

abort commented 10 years ago

Any search parameter happens to end up with this error.

In this case I just tried "test". Log result: Processing by AlbumsController#create as HTML Parameters: {"utf8"=>"✓", "authenticitytoken"=>"r7mLYx3CbiSSREPjX/1dCeJdhOYYaY____", "q"=>"test"} Thanks.

espen commented 10 years ago

This is weird. I'm not sure why the search is doing a POST request. I see that is was due to the form tag being changed from normal html to rails generation in this commit: https://github.com/espen/balder/commit/de0842d203ec134c001a78d3103cfd78255c7528

I just changed this to a GET request and tested it on my install here: http://photos.inspired.no/

(I guess this is what happens when there are no tests.....)