Namespaces, dynamic links and routing

Hello all!

I am new to all of this and I am trying to accomplish a couple things, I am hoping that someone will be able to assist me…

First -

I am trying to set up a namespace within a dynamic link. I have created an admin namespace and I need to following link to go to …/admin/people/xxx

<%= link_to(person) do %> <%= person.fname %> <%= person.lname %> <% end %>

<%= person.title %>

<%= person.position.capitalize %>

Secondly, the current route resolves to{:id} and I would like to it resolve to{:user_name} and I am not sure how to get this to work. I have tried a few different options but I am not quite sure what I am doing here.

resources :people, only: [:index, :show] do resources :pubs, except: [:create, :new, :edit, :destroy] end

I have attempted to add —> get ‘people/:id/user_name’ => ‘people#user_name’, as: :user_name but this has not worked.

Thanks for any help!