Commit 1c33db63 by Thanh Hung Pham

fix

parent f6f9b9f7
......@@ -3,7 +3,18 @@ class UsersController < ApplicationController
@user = User.new
end
def login
@user = User.new
def create
@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
......@@ -3,6 +3,8 @@ Rails.application.routes.draw do
get 'static_pages/home'
get '/register', to: 'users#new'
post '/register', to: 'users#create'
get '/cities', to: 'cities#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