Skip to content

Commit e8afa32

Browse files
committed
Handle camel case properly when redirecting to multi-word controller paths
1 parent 38244ac commit e8afa32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/concerns/has_ownership.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def redirect_if_not_owned(object_to_check, redirect_path)
4747
def redirect_path
4848
model = content_type_from_controller(self.class)
4949
# TODO: proper pluralizing here
50-
"#{model.to_s.downcase}s_path"
50+
"#{model.to_s.underscore}s_path"
5151
end
5252

5353
def owned_by_current_user?(object)

0 commit comments

Comments
 (0)