Skip to content

Commit

Permalink
Handle camel case properly when redirecting to multi-word controller …
Browse files Browse the repository at this point in the history
…paths
  • Loading branch information
drusepth committed Nov 6, 2016
1 parent 38244ac commit e8afa32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/concerns/has_ownership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def redirect_if_not_owned(object_to_check, redirect_path)
def redirect_path
model = content_type_from_controller(self.class)
# TODO: proper pluralizing here
"#{model.to_s.downcase}s_path"
"#{model.to_s.underscore}s_path"
end

def owned_by_current_user?(object)
Expand Down

0 comments on commit e8afa32

Please sign in to comment.