speakerinnen_liste icon indicating copy to clipboard operation
speakerinnen_liste copied to clipboard

profiles controller for admin

Open sabrina-ulbrich opened this issue 5 years ago • 2 comments

There are two actions: update and admin_update in admin/profiles_controller.rb doing similar things, so check to use one action instead.

See: https://github.com/rubymonsters/speakerinnen_liste/blob/master/app/controllers/admin/profiles_controller.rb

sabrina-ulbrich avatar Mar 29 '19 11:03 sabrina-ulbrich

This is my first time looking at Speakerinnen code (yay!), so I could use some input: I've searched in the code, it seems the admin profiles controller (controllers/admin/profiles_controller.rb)'s regular update action is not being used, only the admin_update action. But I might have overlooked something. Has anyone recently looked at this? Seems unnecessary to have an extra admin_update action, as we are already in a controller in the admin scope. So I could put the code inside admin_update, which does a bit more, into update and then change all the paths to point to it as well. Thoughts? :)

ariaru avatar Oct 21 '19 18:10 ariaru

YAY 🎉 Welcome @ariaru \o/ It's a long time ago I worked on this, but it seems to me you are right. I would prefer to use the update action instead of admin_update because it's the rails default (then we don't need an extra route; it's also clear that we use the admin controller, so it's repeated unnecessarily). Maybe it's a good way to look at the tests here https://github.com/rubymonsters/speakerinnen_liste/blob/master/spec/controllers/admin/profiles_controller_spec.rb and check what that covers (I guess not all functionality is tested), write a test for the wanted behavior so you can verify the code works properly. Feel free to ask again! :)

sabrina-ulbrich avatar Oct 22 '19 11:10 sabrina-ulbrich