Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample_app
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
1
Merge Requests
1
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
Tan Phat Nguyen
sample_app
Commits
5bb1eaeb
Commit
5bb1eaeb
authored
Nov 05, 2014
by
Tan Phat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login OK
parent
e97d813a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
16 deletions
+25
-16
app/assets/javascripts/application.js
+1
-12
app/controllers/application_controller.rb
+1
-0
app/views/layouts/_header.html.erb
+17
-3
config/routes.rb
+6
-1
No files found.
app/assets/javascripts/application.js
View file @
5bb1eaeb
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery
//= require jquery_ujs
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require turbolinks
//= require_tree .
//= require_tree .
app/controllers/application_controller.rb
View file @
5bb1eaeb
...
@@ -2,4 +2,5 @@ class ApplicationController < ActionController::Base
...
@@ -2,4 +2,5 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
# For APIs, you may want to use :null_session instead.
protect_from_forgery
with: :exception
protect_from_forgery
with: :exception
include
SessionsHelper
end
end
app/views/layouts/_header.html.erb
View file @
5bb1eaeb
...
@@ -5,8 +5,23 @@
...
@@ -5,8 +5,23 @@
<ul
class=
"nav navbar-nav pull-right"
>
<ul
class=
"nav navbar-nav pull-right"
>
<li>
<%=
link_to
"Home"
,
root_path
%>
</li>
<li>
<%=
link_to
"Home"
,
root_path
%>
</li>
<li>
<%=
link_to
"Help"
,
help_path
%>
</li>
<li>
<%=
link_to
"Help"
,
help_path
%>
</li>
<li>
<%=
link_to
"Log in"
,
'#'
%>
</li>
<%
if
logged_in?
%>
<li>
<%=
link_to
"Users"
,
"#"
%>
</li>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Account
<b
class=
"caret"
></b>
</a>
<ul
class=
"dropdown-menu"
>
<li>
<%=
link_to
"Profile"
,
current_user
%>
</li>
<li>
<%=
link_to
"Settings"
,
"#"
%>
</li>
<li
class=
"divider"
></li>
<li>
<%=
link_to
"Log out"
,
logout_path
,
method:
"delete"
%>
</li>
</ul>
</li>
<%
else
%>
<li>
<%=
link_to
"Log in"
,
login_path
%>
</li>
<%
end
%>
</ul>
</ul>
</nav>
</nav>
</div>
</div>
</header>
</header>
\ No newline at end of file
config/routes.rb
View file @
5bb1eaeb
Rails
.
application
.
routes
.
draw
do
Rails
.
application
.
routes
.
draw
do
get
'sessions/new'
get
'users/new'
get
'users/new'
root
'static_pages#home'
root
'static_pages#home'
get
'help'
=>
'static_pages#help'
get
'help'
=>
'static_pages#help'
get
'about'
=>
'static_pages#about'
get
'about'
=>
'static_pages#about'
get
'contact'
=>
'static_pages#contact'
get
'contact'
=>
'static_pages#contact'
get
'signup'
=>
'users#new'
get
'signup'
=>
'users#new'
get
'login'
=>
'sessions#new'
post
'login'
=>
'sessions#create'
delete
'logout'
=>
'sessions#destroy'
resources
:users
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