Skip to content

Commit

Permalink
Added hall of fame
Browse files Browse the repository at this point in the history
  • Loading branch information
ger619 committed Apr 8, 2024
1 parent fea0162 commit 0fa1f5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/team_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create
if @team.save
format.html { redirect_to team_url(@team), notice: 'Team was successfully created.' }
else
format.html { redirect_to team_url, notice: 'Failure' }
format.html { render :new, status: :unprocessable_entity, notice: 'Failure' }
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Team < ApplicationRecord
belongs_to :user
has_one_attached :image

validates :jersey_number, presence: true, uniqueness: true

def name
"#{first_name} #{second_name} #{last_name}"
end
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "SHOP", product_index_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "HALL OF FAME", hall_of_fames_path %>
</li>
<% if current_user %>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721]">
<%= button_to "LOGOUT", destroy_user_session_path, method: :delete, data: { turbo_method: :delete } %>
Expand Down Expand Up @@ -111,6 +114,9 @@
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "SHOP", product_index_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "HALL OF FAME", hall_of_fames_path %>
</li>
</ul>
</div>

Expand Down

0 comments on commit 0fa1f5a

Please sign in to comment.