Commit d0f4baff by Ngô Trung Hưng

continue create ID8

parent 1f8ea292
Pipeline #975 failed with stages
in 0 seconds
...@@ -34,6 +34,7 @@ gem 'draper' ...@@ -34,6 +34,7 @@ gem 'draper'
gem 'devise' gem 'devise'
gem 'carrierwave' gem 'carrierwave'
gem 'rails-i18n' gem 'rails-i18n'
gem 'i18n-js'
# Use ActiveStorage variant # Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8' # gem 'mini_magick', '~> 4.8'
...@@ -47,6 +48,7 @@ group :development, :test do ...@@ -47,6 +48,7 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'dotenv-rails' gem 'dotenv-rails'
gem 'pry'
end end
group :development do group :development do
......
...@@ -79,6 +79,7 @@ GEM ...@@ -79,6 +79,7 @@ GEM
archive-zip (~> 0.10) archive-zip (~> 0.10)
nokogiri (~> 1.8) nokogiri (~> 1.8)
chronic (0.10.2) chronic (0.10.2)
coderay (1.1.3)
coffee-rails (4.2.2) coffee-rails (4.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0) railties (>= 4.0.0)
...@@ -111,6 +112,8 @@ GEM ...@@ -111,6 +112,8 @@ GEM
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
i18n (1.8.5) i18n (1.8.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-js (3.7.1)
i18n (>= 0.6.6)
image_processing (1.11.0) image_processing (1.11.0)
mini_magick (>= 4.9.5, < 5) mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3) ruby-vips (>= 2.0.17, < 3)
...@@ -152,6 +155,9 @@ GEM ...@@ -152,6 +155,9 @@ GEM
nokogiri (1.10.10) nokogiri (1.10.10)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.5) public_suffix (4.0.5)
puma (3.12.6) puma (3.12.6)
rack (2.2.3) rack (2.2.3)
...@@ -262,11 +268,13 @@ DEPENDENCIES ...@@ -262,11 +268,13 @@ DEPENDENCIES
devise devise
dotenv-rails dotenv-rails
draper draper
i18n-js
jbuilder (~> 2.5) jbuilder (~> 2.5)
kaminari kaminari
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0) mysql2 (>= 0.4.4, < 0.6.0)
nokogiri nokogiri
pry
puma (~> 3.11) puma (~> 3.11)
rails (~> 5.2.4, >= 5.2.4.3) rails (~> 5.2.4, >= 5.2.4.3)
rails-i18n rails-i18n
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives. // about supported directives.
// //
//= require i18n
//= require rails-ujs //= require rails-ujs
//= require activestorage //= require activestorage
//= require turbolinks //= require turbolinks
......
...@@ -1175,6 +1175,12 @@ $main-color: #23303D; ...@@ -1175,6 +1175,12 @@ $main-color: #23303D;
font-weight: 600 !important; font-weight: 600 !important;
} }
} }
.btn-apply_job_favorite.unfavorite {
background-color: #485461;
background-image: linear-gradient(315deg, #485461 0%, #28313b 74%);
}
.box_detail_jobs { .box_detail_jobs {
width: 100%; width: 100%;
height: auto; height: auto;
...@@ -1609,4 +1615,10 @@ $main-color: #23303D; ...@@ -1609,4 +1615,10 @@ $main-color: #23303D;
} }
} }
} }
} }
\ No newline at end of file .lable_radio {
position: relative;
width: 100%;
height: 100%;
z-index: 99999;
}
...@@ -22,6 +22,18 @@ ...@@ -22,6 +22,18 @@
text-decoration: none; text-decoration: none;
} }
} }
.link_favorite.in_block {
position: absolute;
z-index: revert;
top: 50%;
transform: translateY(-50%);
font-size: 20px;
color: #483ea2d1;
&:hover {
color: #1135e6;
}
}
.link_favorite.active { .link_favorite.active {
color: #e62958 !important; color: #e62958 !important;
} }
......
// Place all the styles related to the favorite controller here. // Place all the styles related to the favorite controller here.
// They will automatically be included in application.css. // They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/ // You can use Sass (SCSS) here: http://sass-lang.com/
.box_scroll{
width: 100%;
height: 60vh;
overflow-x: hidden;
overflow-y: scroll;
}
.box_radio {
width: 20px;
height: 20px;
margin: auto;
position: relative;
top: 50%;
left: 80%;
transform: translateY(-50%);
}
.radio_id {
position: relative;
z-index: 999999999999;
top: 50px;
}
[type="radio"] {
cursor: pointer;
width: 20px;
height: 20px;
transition: ease-in 0.3s;
}
[type="radio"]:checked {
transition: ease-in 0.3s;
}
@media only screen and (max-width: 992px) {
.container {
.btn_apply_job {
display: none;
}
}
.link_favorite.in_block {
right: 30px;
}
}
@media only screen and (max-width: 768px) {
.link_favorite.in_block {
right: 15px;
}
}
@media only screen and (max-width: 576px) {
.link_favorite.in_block {
transform: translateY(-250%);
}
.box_my_page_header {
h4 {
font-size: 16px;
}
}
}
\ No newline at end of file
::-webkit-scrollbar {
width: 5px;
}
/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px grey;
border-radius: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #483ea2d1;
border-radius: 10px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #8c80ffd1;
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base ...@@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller? before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_locale before_action :set_locale
before_action :store_user_location!, if: :storable_location?
def set_locale def set_locale
locale = (user_signed_in? ? current_user.language : params[:locale].to_s.strip).to_sym locale = (user_signed_in? ? current_user.language : params[:locale].to_s.strip).to_sym
...@@ -16,10 +17,31 @@ class ApplicationController < ActionController::Base ...@@ -16,10 +17,31 @@ class ApplicationController < ActionController::Base
{ locale: I18n.locale } { locale: I18n.locale }
end end
def authenticate_user!
return redirect_to new_user_session_path unless user_signed_in?
super
end
protected protected
def configure_permitted_parameters def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :cv, :password) } devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :cv, :password) }
devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :cv, :password, :current_password) } devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :cv, :password, :current_password) }
end end
private
# Its important that the location is NOT stored if:
# - The request method is not GET (non idempotent)
# - The request is handled by a Devise controller such as Devise::SessionsController as that could cause an
# infinite redirect loop.
# - The request is an Ajax request as this can lead to very unexpected behaviour.
def storable_location?
request.get? && is_navigational_format? && !devise_controller? && !request.xhr?
end
def store_user_location!
# :user is the scope we are authenticating
store_location_for(:user, request.fullpath)
end
end end
...@@ -3,29 +3,25 @@ ...@@ -3,29 +3,25 @@
class FavoriteController < ApplicationController class FavoriteController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
def discard_flash
flash.discard
end
def index def index
@list_favorited = current_user.favorites.all @favorites = current_user.favorites.map(&:job)
end
def check_user_signin
flash[:error] = t('devise.failure.unauthenticated')
redirect_to new_user_session_path unless user_signed_in?
end end
def create def create
return redirect_to root_path if Job.find(params[:job_id]).blank? return redirect_to root_path if Job.find(params[:job_id]).blank?
@favorite = current_user.favorites.new(job_id: params[:job_id]) @favorite = current_user.favorites.new(job_id: params[:job_id])
if @favorite.invalid?
helpers.render_errors(@favorite)
redirect_to root_path
end
respond_to :js if @favorite.save respond_to :js if @favorite.save
end end
def destroy def destroy
@favorite = current_user.favorites.find_by(id: params[:favorite_id]) @favorite = current_user.favorites.find_by(id: params[:favorite_id])
return redirect_to root_path if @favorite.blank? return redirect_to root_path if @favorite.blank?
respond_to :js if @favorite.destroy respond_to :js if @favorite.destroy
end end
end end
...@@ -9,4 +9,8 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -9,4 +9,8 @@ class RegistrationsController < Devise::RegistrationsController
def after_update_path_for(resource) def after_update_path_for(resource)
my_page_path my_page_path
end end
def after_sign_in_path_for(resource)
stored_location_for(resource) || root_path
end
end end
# frozen_string_literal: true
class SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
def create
self.resource = warden.authenticate!(auth_options)
set_flash_message!(:notice, :signed_in)
sign_in(resource_name, resource)
yield resource if block_given?
respond_with resource, location: stored_location_for(resource) || root_path
end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
end
module FavoriteHelper module FavoriteHelper
def render_errors(obj)
obj.errors.full_messages.each { |mess| flash[:warning] = mess }
end
end end
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
class Favorite < ApplicationRecord class Favorite < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :job belongs_to :job
validates_uniqueness_of :user_id, scope: :job_id, message: I18n.t('favorite.liked')
end end
$('.block_link_favorite').bind('ajax:success', function() { $('.block_link_favorite').bind('ajax:success', function() {
$(this).html("<%= j render 'job/link_destroy',favorite_id: @favorite.id %>") $(this).html("<%= j render 'job/link_destroy',favorite_id: @favorite.id %>");
}); change_number_of_favorite()
\ No newline at end of file });
$('.btn_apply_job').bind('ajax:success', function() {
change_number_of_favorite()
$(this).html("<%= j render 'job/link_destroy_favorite_in_detail',favorite_id: @favorite.id %>")
});
function change_number_of_favorite() {
if (I18n.locale == 'vi') {
$('.number_favorite').text('('+<%=current_user.favorites.count%>+')' + ' Yêu thích' );
} else if (I18n.locale == 'en') {
$('.number_favorite').text('('+<%=current_user.favorites.count%>+')' + ' Favotite' );
}
}
$('.block_link_favorite').bind('ajax:success', function() { $('.block_link_favorite').bind('ajax:success', function() {
$(this).html("<%= j render 'job/link_create',job_id: @favorite.job_id %>") $(this).html("<%= j render 'job/link_create',job_id: @favorite.job_id %>")
}); change_number_of_favorite()
\ No newline at end of file });
$('.btn_apply_job').bind('ajax:success', function() {
$(this).html("<%= j render 'job/link_create_favorite_in_detail',job_id: @favorite.job_id %>")
change_number_of_favorite()
});
$('.con').bind('ajax:success', function() {
$(this).fadeOut('fast', 'swing');
change_number_of_favorite()
});
function change_number_of_favorite() {
if (I18n.locale == 'vi') {
$('.number_favorite').text('('+<%=current_user.favorites.count%>+')' + ' Yêu thích' );
} else if (I18n.locale == 'en') {
$('.number_favorite').text('('+<%=current_user.favorites.count%>+')' + ' Favotite' );
}
}
weklhjdfqwl;edjwjhqgbedklqwheuiqw <div class="container">
<%= render 'job/block_job_mini' %> <div class="box_my_page">
\ No newline at end of file <div class="row">
<div class="col-lg-12">
<div class="box_my_page_header">
<h4><%= t('favorite.list') %></h4>
</div>
</div>
</div>
</div>
</div>
<div style="width: 100%; height: 150px"></div>
<% if @favorites.blank? %>
<div class="col-lg-12">
<div class="breadcrumb_total_search">
<span class="breadcrumb-item active">
<%= t('favorite.list_blank') %>
</span>
</div>
</div>
<div style="width: 100%; height: 55vh"></div>
<% else %>
<div class="container">
<%= form_with url: apply_path, method: :get, local: true do |f| %>
<div class="box_scroll">
<%= f.collection_radio_buttons :job_id, @favorites, :id, :id do |radio| %>
<%= radio.radio_button(class: 'radio_id') %>
<%= render 'job/block_job_mini', data: radio.object %>
<% end %>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="btn_apply_job">
<%= f.submit t('pages.detail.btr_text_submit_cv'), class: 'btn btn-apply_job' %>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
wrewerwerwetet <div class="con">
\ No newline at end of file <div class="container">
<div class="row">
<div class="col-sm-12">
<div class="box_jobs mini">
<div class="row">
<div class="d-none d-lg-block col-lg-1">
<div class="box_radio">
</div>
</div>
<div class="col-lg-10 col-md-11 col-sm-11">
<div class="box_info">
<div class="lol">
<%= link_to data.name, detail_job_path(id: data.id), class: 'job_name' %>
</div>
<div class="cop">
<h5 class="box_info_copany_name"><i class="far fa-building"></i> <%= data.company.name %></h5>
</div>
<div class="loc">
<h5 class="box_info_location"><i class="fas fa-map-marker-alt"></i>
<%= data.cities.map(&:name).join(' | ') %>
</h5>
</div>
<h5 class="box_info_salary"><i class="fas fa-dollar-sign"></i>&nbsp;<%= "#{t('pages.index.salary')}: #{data.salary}" %></h5>
<div class="coc">
<h5 class="box_info_des"><%= strip_tags(data.description) %></h5>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<%= link_to '<i class="fas fa-trash"></i>'.html_safe, destroy_favorite_path(favorite_id: data.favorites.ids), method: :delete, remote: true, class: 'link_favorite in_block' %>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<%= link_to t('pages.index.btn_text_favorite'), favorite_path(job_id: job_id), method: :post, remote: true, class: 'btn btn-apply_job_favorite' %>
\ No newline at end of file
<%= link_to t('pages.index.unfavorite'), destroy_favorite_path(favorite_id: favorite_id), method: :delete, remote: true, class: 'btn btn-apply_job_favorite unfavorite' %>
\ No newline at end of file
...@@ -97,7 +97,12 @@ ...@@ -97,7 +97,12 @@
</div> </div>
<div class="col-lg-6 col-md-6"> <div class="col-lg-6 col-md-6">
<div class="btn_apply_job"> <div class="btn_apply_job">
<%= link_to t('pages.index.btn_text_favorite'), '#', class: 'btn btn-apply_job_favorite' %> <% favorite_id = current_user.favorites.find_by(job_id: @job.id).try(:id) if user_signed_in? %>
<% if favorite_id.blank? %>
<%= render 'link_create_favorite_in_detail', job_id: @job.id %>
<% else %>
<%= render 'link_destroy_favorite_in_detail', favorite_id: favorite_id %>
<% end %>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
<div class="header_top_menu_right"> <div class="header_top_menu_right">
<ul class="list_menu_header_right"> <ul class="list_menu_header_right">
<li class="list_item_menu_header_right"> <li class="list_item_menu_header_right">
<%= link_to t('pages.index.favorite'), favorite_index_path, class: 'link_item_menu_header_right' %> <% if user_signed_in? %>
<%= link_to "(#{current_user.favorites.count}) #{t('pages.index.favorite')}", favorite_index_path, class: 'link_item_menu_header_right number_favorite' %>
<% else %>
<%= link_to t('pages.index.favorite'), favorite_index_path, class: 'link_item_menu_header_right' %>
<% end %>
</li> </li>
<li class="list_item_menu_header_right"> <li class="list_item_menu_header_right">
<%= link_to t('pages.index.history'), '#', class: 'link_item_menu_header_right' %> <%= link_to t('pages.index.history'), '#', class: 'link_item_menu_header_right' %>
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= render 'shared/shim' %> <%= render 'shared/shim' %>
<script type="text/javascript">
I18n.defaultLocale = "<%= I18n.default_locale %>";
I18n.locale = "<%= I18n.locale %>";
</script>
</head> </head>
<body> <body>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.content { .content {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 48%;
width: 60px; width: 60px;
height: 60px; height: 60px;
border-radius: 50%; border-radius: 50%;
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
0% { transform: rotate(0deg); } 0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); } 100% { transform: rotate(360deg); }
} }
@media only screen and (max-width: 768px) {
.content {
left: 47% !important;
}
}
@media only screen and (max-width: 576px) {
.content {
left: 44% !important;
}
}
</style> </style>
<div class="box_loading"> <div class="box_loading">
......
...@@ -17,6 +17,7 @@ module Venjob ...@@ -17,6 +17,7 @@ module Venjob
config.i18n.available_locales = [:en, :vi] config.i18n.available_locales = [:en, :vi]
config.i18n.default_locale = :en config.i18n.default_locale = :en
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers # Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading # -- all .rb files in that directory are automatically loaded after loading
......
# Split context in several files.
#
# By default only one file with all translations is exported and
# no configuration is required. Your settings for asset pipeline
# are automatically recognized.
#
# If you want to split translations into several files or specify
# locale contexts that will be exported, just use this file to do
# so.
#
# For more informations about the export options with this file, please
# refer to the README
#
#
# If you're going to use the Rails 3.1 asset pipeline, change
# the following configuration to something like this:
#
translations:
- file: 'public/javascripts/en.js'
only: 'en.*'
- file: 'public/javascripts/vn.js'
only: 'vn.*'
#
# If you're running an old version, you can use something
# like this:
#
# translations:
# - file: "app/assets/javascripts/i18n/translations.js"
# only: "*"
...@@ -262,7 +262,7 @@ Devise.setup do |config| ...@@ -262,7 +262,7 @@ Devise.setup do |config|
# should add them to the navigational formats lists. # should add them to the navigational formats lists.
# #
# The "*/*" below is required to match Internet Explorer requests. # The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ['*/*', :html] config.navigational_formats = ["*/*", :html, :js]
# The default HTTP method used to sign out a resource. Default is :delete. # The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete config.sign_out_via = :delete
......
...@@ -11,6 +11,7 @@ en: ...@@ -11,6 +11,7 @@ en:
pages: pages:
index: index:
favorite: 'Favorite' favorite: 'Favorite'
unfavorite: 'Unfavorite'
history: 'History' history: 'History'
signin: 'Sign in' signin: 'Sign in'
register: 'Register' register: 'Register'
...@@ -132,7 +133,13 @@ en: ...@@ -132,7 +133,13 @@ en:
title: 'List Applied Jobs' title: 'List Applied Jobs'
no_record: "You haven't applied yet." no_record: "You haven't applied yet."
already_taken: 'We have received your resume, the employer will contact you as soon as possible.' already_taken: 'We have received your resume, the employer will contact you as soon as possible.'
favorite:
liked: 'You have added job to favorites'
list: 'List of jobs you liked'
list_blank: 'You do not have a favorite job!'
activerecord: activerecord:
attributes: attributes:
applied_job: applied_job:
user_id: '' user_id: ''
favorite:
user_id: ''
...@@ -11,6 +11,7 @@ vi: ...@@ -11,6 +11,7 @@ vi:
pages: pages:
index: index:
favorite: 'Yêu thích' favorite: 'Yêu thích'
unfavorite: 'Không thích nữa'
history: 'Lịch sử' history: 'Lịch sử'
signin: 'Đăng nhập' signin: 'Đăng nhập'
register: 'Đăng ký' register: 'Đăng ký'
...@@ -132,8 +133,14 @@ vi: ...@@ -132,8 +133,14 @@ vi:
title: 'Danh sách công việc đã ứng tuyển' title: 'Danh sách công việc đã ứng tuyển'
no_record: 'Bạn chưa ứng tuyển công việc nào hết.' no_record: 'Bạn chưa ứng tuyển công việc nào hết.'
already_taken: 'Chúng tôi đã tiếp nhận hồ của bạn, nhà tuyển dụng sẽ liên hệ đến bạn trong thời gian sớm nhất.' already_taken: 'Chúng tôi đã tiếp nhận hồ của bạn, nhà tuyển dụng sẽ liên hệ đến bạn trong thời gian sớm nhất.'
favorite:
liked: 'Bạn đã thêm công việc vào yêu thích.'
list: 'Danh sách công việc bạn đã thích'
list_blank: 'Bạn chưa công việc yêu thích!'
activerecord: activerecord:
attributes: attributes:
applied_job: applied_job:
user_id: '' user_id: ''
favorite:
user_id: ''
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Rails.application.routes.draw do Rails.application.routes.draw do
get 'setting', to: 'users#set_lang', as: :set_lang get 'setting', to: 'users#set_lang', as: :set_lang
scope '(:locale)', locale: /en|vi/ do scope '(:locale)', locale: /en|vi/ do
devise_for :users, controllers: { registrations: 'registrations' } devise_for :users, controllers: { sessions: 'sessions', registrations: 'registrations' }
root 'home#index' root 'home#index'
get 'register/:code', to: 'users#confirm_sign_up', as: :confirm_sign_up get 'register/:code', to: 'users#confirm_sign_up', as: :confirm_sign_up
......
alert('You will be redirected to log in.');
window.location = '/users/sign_in';
\ No newline at end of file
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