Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
ThaiMinhPhuc_training
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
phuctmZigexn
ThaiMinhPhuc_training
Commits
38025573
Commit
38025573
authored
Aug 02, 2018
by
phuctmZigexn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp commit
parent
86eea23a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
2 deletions
+123
-2
app/assets/stylesheets/custom.scss
+62
-0
app/controllers/users_controller.rb
+17
-0
app/helpers/users_helper.rb
+8
-0
app/views/layouts/application.html.erb
+1
-0
app/views/users/new.html.erb
+21
-2
app/views/users/show.html.erb
+12
-0
config/routes.rb
+2
-0
No files found.
app/assets/stylesheets/custom.scss
View file @
38025573
...
@@ -3,6 +3,11 @@
...
@@ -3,6 +3,11 @@
/* mixins, variables, etc */
/* mixins, variables, etc */
$gray-medium-light
:
#eaeaea
;
$gray-medium-light
:
#eaeaea
;
@mixin
box_sizing
{
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
body
{
body
{
padding-top
:
60px
;
padding-top
:
60px
;
...
@@ -94,3 +99,59 @@ footer {
...
@@ -94,3 +99,59 @@ footer {
}
}
}
}
.debug_dump
{
clear
:
both
;
float
:
left
;
width
:
100%
;
margin-top
:
45px
;
@include
box_sizing
;
}
// sidebar
aside
{
section
.user_info
{
margin-top
:
20px
;
}
section
{
padding
:
10px
0
;
margin-top
:
20px
;
&
:first-child
{
border
:
0
;
padding-top
:
0
;
}
span
{
display
:
block
;
margin-top
:
3px
;
line-height
:
1
;
}
h1
{
font-size
:
1
.4em
;
text-align
:
left
;
letter-spacing
:
-1px
;
margin-bottom
:
3px
;
margin-top
:
0px
;
}
}
}
.gravatar
{
float
:
left
;
margin-right
:
10px
;
}
.gravatar_edit
{
margin-top
:
15px
;
}
// form
input
,
textarea
,
select
,
.uneditable-input
{
border
:
1px
solid
#bbb
;
width
:
100%
;
margin-bottom
:
15px
;
@include
box_sizing
;
}
input
{
height
:
auto
!
important
;
}
\ No newline at end of file
app/controllers/users_controller.rb
View file @
38025573
class
UsersController
<
ApplicationController
class
UsersController
<
ApplicationController
def
show
@user
=
User
.
find
(
params
[
:id
])
# debugger
end
def
new
@user
=
User
.
new
end
def
create
@user
=
User
.
new
(
params
[
:user
])
if
@user
.
save
else
render
'new'
end
end
end
end
app/helpers/users_helper.rb
0 → 100644
View file @
38025573
module
UsersHelper
def
gravatar_for
(
user
,
size:
80
)
gravatar_id
=
Digest
::
MD5
::
hexdigest
(
user
.
email
.
downcase
)
gravatar_url
=
"https://secure.gravatar.com/avatar/
#{
gravatar_id
}
?s=
#{
size
}
"
image_tag
(
gravatar_url
,
alt:
user
.
name
,
class:
"gravatar"
)
end
end
\ No newline at end of file
app/views/layouts/application.html.erb
View file @
38025573
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<div
class=
"container"
>
<div
class=
"container"
>
<%=
yield
%>
<%=
yield
%>
<%=
render
'layouts/footer'
%>
<%=
render
'layouts/footer'
%>
<%=
debug
(
params
)
if
Rails
.
env
.
development?
%>
<!-- display debug information about each page -->
</div>
</div>
</body>
</body>
</html>
</html>
app/views/users/new.html.erb
View file @
38025573
<%
provide
(
:title
,
'Sign up'
)
%>
<%
provide
(
:title
,
'Sign up'
)
%>
<h1>
Sign up
</h1>
<h1>
Sign up
</h1>
<p>
This will be a signup page for new users.
</p>
\ No newline at end of file
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offet-3"
>
<%=
form_for
@user
do
|
f
|
%>
<%=
f
.
label
:name
%>
<%=
f
.
text_field
:name
%>
<%=
f
.
label
:email
%>
<%=
f
.
email_field
:email
%>
<%=
f
.
label
:password
%>
<%=
f
.
password_field
:password
%>
<%=
f
.
label
:password_confirmation
,
"Confirmation"
%>
<%=
f
.
password_field
:password_confirmation
%>
<%=
f
.
submit
"Create my account"
,
class:
"btn btn-primary"
%>
<%
end
%>
</div>
</div>
\ No newline at end of file
app/views/users/show.html.erb
0 → 100644
View file @
38025573
<%
provide
(
:title
,
@user
.
name
)
%>
<div
class=
"row"
>
<aside
class=
"col-md-4"
>
<section
class=
"user_info"
>
<h1>
<%=
gravatar_for
@user
%>
<%=
@user
.
name
%>
</h1>
</section>
</aside>
</div>
config/routes.rb
View file @
38025573
...
@@ -4,4 +4,6 @@ Rails.application.routes.draw do
...
@@ -4,4 +4,6 @@ Rails.application.routes.draw do
get
'/about'
,
to:
'static_pages#about'
get
'/about'
,
to:
'static_pages#about'
get
'/contact'
,
to:
'static_pages#contact'
get
'/contact'
,
to:
'static_pages#contact'
get
'/signup'
,
to:
'users#new'
get
'/signup'
,
to:
'users#new'
resources
:users
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment