Why won't ternary operator work with redirect
问题 I love the ternary operator. It really cleans up the code look, but I have a case where it won't behave correctly in a Rails controller. I get a syntax error: unexpected tSYMBEG, expecting keyword_do or '{' or '(' I consistently get this issue, it light switches on changing the statement below to a ternary operator. It always happens when I'm trying to use it in conjunction with a redirect statement. Am I unaware of a rule about this? if nexti==0 then redirect_to :back else redirect_to edit