I'm trying to create a User show page which will act as a dashboard. I believe that I've made good progress following the advice listed here: Creating a `Users` show page using Devise but I'm not quite there yet.
I've done the following so far:
Created the show method in the users_controller.rb file
def show
@user = User.find(params[:id])
end
Created the route in routes.rb
devise_for :users
resources :users, :only => [:show]
Created the view show.html.erb under devise/registrations/show.html.erb
<%= @user.name %>
Now I would assume that I could access this page for user with ID=1 via localhost:3000/users/1, however when I do so I receive the error:
Missing template users/show, application/show with {:locale=>[:en], :formats=>[:html], >:handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "c:/Users /Evan/Desktop/reviewdraft/app/views" * "c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0 /gems/devise-3.4.1/app/views"
Any advice on how I could resolve this error?
show.html.erbtoapp/views/users/show.html.erbI'm guessing the problem is that the current location isn't in the expected location for that controller action. Alternatively, you can probably userenderin the action to spit out the file's current location, but putting it in the right place is probably a lot cleaner overall. - Brian