Skip to content

Commit

Permalink
Merge pull request #97 from motohiro-mm/feature/add_about_page
Browse files Browse the repository at this point in the history
使い方ページの追加
  • Loading branch information
motohiro-mm authored Oct 2, 2024
2 parents 1fa00d7 + 9d20aee commit 67b38d5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class HomeController < ApplicationController
skip_before_action :check_logged_in
skip_before_action :check_logged_in, only: %i[index welcome terms privacy]

def index
redirect_to meal_plans_path if current_user.present?
Expand All @@ -15,4 +15,6 @@ def welcome
def terms; end

def privacy; end

def about; end
end
6 changes: 6 additions & 0 deletions app/views/home/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div>
<h1>使い方</h1>
<p>
今後文章画像追加する!!!
</p>
</div>
5 changes: 5 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
<%= link_to '利用規約', terms_path, class: 'ml-4 text-stone-800 hover:underline' %>
<%= link_to 'プライバシーポリシー', terms_path, class: 'ml-4 text-stone-800 hover:underline' %>
</div>
<div>
<p>
ここに使い方を書く!
</p>
</div>
</div>
5 changes: 5 additions & 0 deletions app/views/home/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@
<%= link_to '利用規約', terms_path, class: 'ml-4 text-stone-800 hover:underline' %>
<%= link_to 'プライバシーポリシー', terms_path, class: 'ml-4 text-stone-800 hover:underline' %>
</div>
<div>
<p>
ここに使い方を書く!
</p>
</div>
</div>
3 changes: 3 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
</div>
<div>
<%= link_to '< home', root_path, class: 'ml-4 text-stone-300 hover:underline' %>
<% if current_user %>
<%= link_to '使い方', about_path, class: 'ml-4 text-stone-300 hover:underline' %>
<% end %>
<%= link_to '利用規約', terms_path, class: 'ml-4 text-stone-300 hover:underline' %>
<%= link_to 'プライバシーポリシー', privacy_path, class: 'ml-4 text-stone-300 hover:underline' %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
get 'welcome', to: 'home#welcome'
get 'terms', to: 'home#terms'
get 'privacy', to: 'home#privacy'
get 'about', to: 'home#about'

# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

Expand Down

0 comments on commit 67b38d5

Please sign in to comment.