Commit 1c33db63 by Thanh Hung Pham

fix

parent f6f9b9f7
...@@ -3,7 +3,18 @@ class UsersController < ApplicationController ...@@ -3,7 +3,18 @@ class UsersController < ApplicationController
@user = User.new @user = User.new
end end
def login def create
@user = User.new @user = User.new(user_params)
if @user.save
# TODO
else
render 'new'
end
end
private
def user_params
params.require(:user).permit(:email, :password)
end end
end end
...@@ -3,6 +3,8 @@ Rails.application.routes.draw do ...@@ -3,6 +3,8 @@ Rails.application.routes.draw do
get 'static_pages/home' get 'static_pages/home'
get '/register', to: 'users#new' get '/register', to: 'users#new'
post '/register', to: 'users#create'
get '/cities', to: 'cities#show' get '/cities', to: 'cities#show'
get '/categories', to: 'categories#show' get '/categories', to: 'categories#show'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment