Last active
March 14, 2017 13:41
-
-
Save jetrubyshared/76936bb57589b09aad5d03c413cdef04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ | |
## WRONG ## | |
############ | |
def some_method | |
SomeLongClassName.new(params).perform_action if something_true? | |
# a lot of another code | |
end | |
def create | |
redirect_to(root_path) if @resource.save | |
end | |
############## | |
## RIGHT ## | |
############## | |
def some_method | |
if something_true? | |
SomeLongClassName.new(params).perform_action | |
end | |
# a lot of another code | |
end | |
def create | |
if @resource.save | |
redirect_to root_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment