Create A Simple User Directory Page
I want to create a new users view page that lists info from all currently registered users. I created a new view page in 'users/registrations' called "display.html.erb". I added to my 'registrations_controller': def display @users = User.all end. Then I added to my 'routes.rb' under devise_for: devise_scope :users do get '/users/:id' => 'users#display', as: 'display'. I'm getting a routing error. On my 'display.html.erb' page I have: <% @users.each do |user| %><br><%= @user.business_name %><br><% end %>. What am I doing wrong? I thought this would be the same type of set up as creating my home listings page, but the one hitch is getting the new view page to be recognized in the routes file. Yes?
Posted over 4 years ago by