Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
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
2
Merge Requests
2
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
Thanh Hung Pham
veNJOB
Commits
b784e14a
Commit
b784e14a
authored
Jul 07, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Download cv
parent
ba0c3d60
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
14 deletions
+8
-14
app/controllers/registrations_controller.rb
+4
-0
app/models/user.rb
+2
-7
app/views/devise/registrations/edit.html.erb
+0
-6
app/views/devise/registrations/show.html.erb
+1
-1
config/routes.rb
+1
-0
lib/tasks/jobs.csv
+0
-0
lib/tasks/jobs.zip
+0
-0
No files found.
app/controllers/registrations_controller.rb
View file @
b784e14a
...
@@ -28,6 +28,10 @@ class RegistrationsController < Devise::RegistrationsController
...
@@ -28,6 +28,10 @@ class RegistrationsController < Devise::RegistrationsController
render
:show
render
:show
end
end
def
download_file
send_file
(
"
#{
Rails
.
root
}
/app/upload/
#{
current_user
.
cv_name
}
"
,
filename:
current_user
.
cv_name
)
end
protected
protected
def
after_sign_up_path_for
(
resource
)
def
after_sign_up_path_for
(
resource
)
...
...
app/models/user.rb
View file @
b784e14a
...
@@ -14,14 +14,9 @@ class User < ApplicationRecord
...
@@ -14,14 +14,9 @@ class User < ApplicationRecord
file_name
=
upload
.
original_filename
if
upload
!=
''
file_name
=
upload
.
original_filename
if
upload
!=
''
file
=
upload
.
read
file
=
upload
.
read
file_type
=
file_name
.
split
(
'.'
).
last
upload_root
=
"
#{
Rails
.
root
}
/app/upload/"
new_name_file
=
Time
.
now
.
to_i
name_folder
=
'upload'
new_file_name_with_type
=
"
#{
new_name_file
}
."
+
file_type
upload_root
=
"
#{
Rails
.
root
}
/app/"
File
.
open
(
upload_root
+
file_name
,
'wb'
)
do
|
f
|
File
.
open
(
upload_root
+
"
#{
name_folder
}
/"
+
new_file_name_with_type
,
'wb'
)
do
|
f
|
f
.
write
(
file
)
f
.
write
(
file
)
end
end
end
end
...
...
app/views/devise/registrations/edit.html.erb
View file @
b784e14a
...
@@ -35,10 +35,4 @@
...
@@ -35,10 +35,4 @@
<%=
f
.
submit
"Update"
,
class:
'btn btn-primary'
%>
<%=
f
.
submit
"Update"
,
class:
'btn btn-primary'
%>
<%
end
%>
<%
end
%>
<!--
<h3>Cancel my account</h3>
<p>Unhappy?
<%=
button_to
"Cancel my account"
,
registration_path
(
resource_name
),
data:
{
confirm:
"Are you sure?"
},
method: :delete
%>
</p>
<%=
link_to
"Back"
,
:back
%>
-->
</div>
</div>
app/views/devise/registrations/show.html.erb
View file @
b784e14a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Cv name
</label><br
/>
<label>
Cv name
</label><br
/>
<
input
type=
"text"
value=
"
<%=
current_user
.
cv_name
%>
"
,
class=
"form-control"
,
readonly
/
>
<
%=
link_to
current_user
.
cv_name
,
registrations_download_file_path
%
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
config/routes.rb
View file @
b784e14a
...
@@ -10,6 +10,7 @@ Rails.application.routes.draw do
...
@@ -10,6 +10,7 @@ Rails.application.routes.draw do
devise_scope
:user
do
devise_scope
:user
do
post
'/confirmations/update_confirm'
,
to:
'confirmations#update_confirm'
post
'/confirmations/update_confirm'
,
to:
'confirmations#update_confirm'
get
'/registrations/show'
,
to:
'registrations#show'
get
'/registrations/show'
,
to:
'registrations#show'
get
'/registrations/download_file'
,
to:
'registrations#download_file'
end
end
devise_for
:users
,
controllers:
{
registrations:
'registrations'
,
devise_for
:users
,
controllers:
{
registrations:
'registrations'
,
confirmations:
'confirmations'
}
confirmations:
'confirmations'
}
...
...
lib/tasks/jobs.csv
0 → 100644
View file @
b784e14a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
app/upload/1499411244
.zip
→
lib/tasks/jobs
.zip
View file @
b784e14a
File moved
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