开发者

Rails equivalent to php die()?

开发者 https://www.devze.com 2023-03-08 20:21 出处:网络
Is there an equivalent in Rails to PHP\'s die()? I have a case where it would make my controller code a 开发者_JAVA技巧little cleaner to set it up in a way that would sometimes call render twice, unl

Is there an equivalent in Rails to PHP's die()?

I have a case where it would make my controller code a 开发者_JAVA技巧little cleaner to set it up in a way that would sometimes call render twice, unless there is a die() that is.


abort("Message goes here")

See: How to create an exit message


A direct mapping of PHP's die() in Ruby would be Kernel::exit()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号