Rails namespace admin on custom subdomain

后端 未结 2 1330
别那么骄傲
别那么骄傲 2021-01-07 00:24

My rails app is set to use subdomains as described in this RailsCast:

http://railscasts.com/episodes/221-subdomains-in-rails-3

Now, I would like to add an ad

2条回答
  •  别那么骄傲
    2021-01-07 01:10

    There are several important factors here

    Firstly, you'll need to see what the constraint params look like with "multi" subdomains. Instead of splitting, Rails may have admin.company as the subdomain

    If we take the idea that Rails will split the subdomains into two, which one is being called as the "parent"?

    namespace :admin, path: '/', constraints: { subdomain: 'admin' } do
      constraints(Subdomain) do
        resources :blogs, only: :show, path_names: { show: "" }
      end
    end
    

    If you give us some more info on the request (params etc), we'll be in a much better position to help!

提交回复
热议问题