Skip to content

Modeling users#3

Open
trungngoprogramming wants to merge 2 commits into
masterfrom
modeling-users
Open

Modeling users#3
trungngoprogramming wants to merge 2 commits into
masterfrom
modeling-users

Conversation

@trungngoprogramming
Copy link
Copy Markdown
Owner

No description provided.

@trungngoprogramming
Copy link
Copy Markdown
Owner Author

ready

Comment thread app/models/user.rb
@@ -0,0 +1,8 @@
class User < ApplicationRecord
before_save{email.downcase!}
validates :name, presence: true, length: {maximum: 50}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e tìm hiểu gem config
https://github.com/railsconfig/config
để dùng cho số 50 e

Comment thread app/models/user.rb Outdated
validates :name, presence: true, length: {maximum: 50}
VALID_EMAIL_REGAX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :name, presence: true, length: {maximum: 255},
format: {with: VALID_EMAIL_REGAX},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REGAX -> REGEX chứ e hè

Comment thread app/views/layouts/_header.html.erb Outdated
<ul class="nav navbar-nav navbar-right">
<li><%= link_to (t ".home"), "#" %></li>
<li><%= link_to (t ".help"), "#" %></li>
<li><%= link_to (t ".home"), "/#{locale}/" %></li>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao lại có // ở đây e?

@nvtanh
Copy link
Copy Markdown

nvtanh commented Jan 16, 2018

commented
2 commit rồi e ơi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants