more migrating views, get user search working

This commit is contained in:
Dylan Knutson
2025-02-12 01:59:33 +00:00
parent be8e52c792
commit 369fa71007
53 changed files with 863 additions and 244 deletions

View File

@@ -18,34 +18,56 @@ Rails.application.routes.draw do
end
end
resources :domain_users,
only: [:index],
resources :users,
only: %i[index show],
controller: "domain/users",
path: "users"
resources :domain_posts,
only: %i[index],
controller: "domain/posts",
path: "posts"
Domain::RouteHelper::DOMAIN_USER_RESOURCES.each do |resource_data|
resources resource_data.resource_name,
only: [:show],
param: resource_data.param,
controller: resource_data.controller,
path: "users/#{resource_data.subpath}"
end
Domain::RouteHelper::DOMAIN_POST_RESOURCES.each do |resource_data|
resources resource_data.resource_name,
only: %i[show],
param: resource_data.param,
controller: resource_data.controller,
path: "posts/#{resource_data.subpath}" do
get :faved_by, on: :member
constraints: {
id: %r{[^/]+/[^/]+},
} do
get :search_by_name, on: :collection
resources :posts, only: [:index], controller: "domain/posts" do
get :favorites, on: :member
end
end
resources :posts,
only: %i[index show],
controller: "domain/posts",
constraints: {
id: %r{[^/]+/[^/]+},
} do
get :faved_by, on: :member
end
# Domain::RouteHelper::DOMAIN_POST_RESOURCES.each do |resource_data|
# resolve resource_data.klass.name do |post|
# domain_post_path(post)
# end
# end
# Domain::RouteHelper::DOMAIN_USER_RESOURCES.each do |resource_data|
# resources resource_data.resource_name,
# only: [:show],
# param: resource_data.param,
# controller: resource_data.controller,
# path: "users/#{resource_data.subpath}" do
# resources :posts,
# controller: "domain/posts",
# only: %i[index],
# path: "posts"
# end
# end
# Domain::RouteHelper::DOMAIN_POST_RESOURCES.each do |resource_data|
# resources resource_data.resource_name,
# only: %i[show],
# param: resource_data.param,
# controller: resource_data.controller,
# path: "posts/#{resource_data.subpath}" do
# get :faved_by, on: :member
# end
# end
namespace :domain do
namespace :fa do
resources :users,