lundi 2 octobre 2017

Newbie RoR - routes

Don't know exactly how to do this in rails, i'm just learning and trying to get this app up and running. Problem is I can't get the routes right to edit users. Below are the _header.html.erb which has edit users link, and routes.rb, if you need more info please let me know.

<li><%= link_to "Settings", edit_user_path(current_user) %></li>

and

Rails.application.routes.draw do

root 'static_pages#home'

get 'help'  => 'static_pages#help'
get 'about' => 'static_pages#about'
get 'contact' => 'static_pages#contact'
get 'contact' => 'static_pages#contact'
get 'signup' => 'users#new'
get 'login' => 'sessions#new'
post 'login' => 'sessions#create'
delete 'logout' => 'sessions#destroy'



get '/all_users', :to => 'users#index'

get '/users/:id', :to => 'users#show', :as => :user

resources :users do
get user
end
resources :account_activations, only: [:edit]
end

Aucun commentaire:

Enregistrer un commentaire