forked from quentinkhoo/hello-anya
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71723aa
commit 7134bfe
Showing
9 changed files
with
160 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
module ApplicationHelper | ||
def flash_class(level) | ||
case level | ||
when :notice then "alert-notice" | ||
when :alert then "alert-alert" | ||
else "alert" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<nav> | ||
<ul> | ||
<li><a href="/">Home</a></li> | ||
<li><a href="/pages/anya">Secret Page</a></li> | ||
<% if current_user %> | ||
<li class='right'><%= link_to 'Log out', user_session_path(current_user), data: {turbo_method: :delete} %></li> | ||
<% else %> | ||
<li class='right'><%= link_to 'Login', new_user_session_path %></li> | ||
<li class='right'><%= link_to 'Register', new_user_path %></li> | ||
<% end %> | ||
</ul> | ||
</nav> | ||
<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<h1>This is the secret page</h1> | ||
<h1>Secret: Anya like Peanuts</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<%= image_tag "data:image/png;base64,#{@img}", style: "width:30%; height:30%" %> | ||
|
||
<% if current_user %> | ||
<h1>Ohayaimasu, <%= current_user.name %></h1> | ||
<%= image_tag "data:image/png;base64,#{@img}", class: "styled-image" %> | ||
<p class="styled-paragraph"> | ||
<% @anyas.each do |anya| %> | ||
<p><%= anya %></p><br> | ||
<%= anya %> | ||
<br> | ||
<% end %> | ||
<%= link_to 'Log out', user_session_path(current_user), data: {turbo_method: :delete} %><br> | ||
</p><br> | ||
<% else %> | ||
<h1>Yororosu onegaisurumasu - Anya</h1> | ||
<%= link_to 'Login', new_user_session_path %><br> | ||
<%= link_to 'Register', new_user_path %><br> | ||
<% end %> | ||
<%= link_to 'Secret page', '/pages/anya' %> | ||
<%= image_tag "data:image/png;base64,#{@img}", class: "styled-image" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1>Users#index</h1> | ||
<h1>Users</h1> | ||
|
||
<%= link_to 'New User', new_user_path %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1>Users#new</h1> | ||
<h1>Registration</h1> | ||
<%= form_with model: @user do |f| %> | ||
<% if @user.errors.any? %> | ||
<div> | ||
|