-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsubscribing responds with "Something went wrong!" #41
Comments
OK, this is solved... i was briefly confused by the fact that set_following in subscription_controller returns a boolean for the state of following, rather than for the success of following/unfollowing. I left that as is, but added a kinda janky error message throwing if it fails. Is it worth making a stronger convention for returning a boolean? It's def. a style thing, and shouldn't cause too much more trouble. |
I did that for idempotence. If you click "set_following :true" four times in a row, "set_following Returning a boolean indicates which function was just performed and what If there's an error, then error handling techniques would be more On Sun, May 4, 2014 at 5:32 PM, Jeffrey Warren [email protected]:
|
That makes sense, thanks for explaining. I guess I'm not that used to doing proper error handling beyond checking for the success of something and flash[:error]ing a message. Should brush up on error handling in Rails... it ought to make my code a bit more terse as well. |
I'm still making my way through the Ruby guide. I finally understand wtf is Anyway, this is a few chapters ahead of where I'm at: On Mon, May 5, 2014 at 11:58 AM, Jeffrey Warren [email protected]:
|
Something in here: https://github.com/publiclab/plots2/blob/master/app/controllers/subscription_controller.rb#L106-L134
The text was updated successfully, but these errors were encountered: