Open stgeneral opened 2 years ago
Solution:
# config/routes.rb
resource :org, only: [:show]
# app/controllers/orgs_controller.rb
class OrgsController < ResourcesController
private
def find_resource
id_param.present? ? super : current_user.org
end
end
Add support or just a description for using https://guides.rubyonrails.org/routing.html#singular-resources.