Skip to content

Commit

Permalink
adding a player fixing an error
Browse files Browse the repository at this point in the history
  • Loading branch information
ger619 committed Apr 17, 2024
1 parent f48f123 commit 8d6c764
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/controllers/team_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def new
end

def create
@team = Team.new(news_params)
@team = Team.new(team_params)
@team.user_id = current_user.id

respond_to do |format|
Expand All @@ -42,7 +42,7 @@ def edit
def update
@team = Team.find(params[:id])
respond_to do |format|
if @team.update(news_params)
if @team.update(team_params)
format.html { redirect_to team_url(@team.id), notice: 'Team was successfully updated.' }
else
format.html { redirect_to team_index_url, notice: 'Failure' }
Expand All @@ -52,7 +52,7 @@ def update

private

def news_params
def team_params
params.require(:team).permit(:first_name, :second_name, :last_name, :position, :image, :jersey_number, :about,
:user_id)
end
Expand Down
1 change: 0 additions & 1 deletion app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def initialize(user)
can :manage, Motor::Admin, :all
elsif user.moderator?
can :manage, [Advert, Club, HallOfFame, News, Opponent, OpponentTeam, Product, Team], :all
cannot :manage, Motor::Admin, :all
else
can :read, [Advert, Club, HallOfFame, News, Opponent, OpponentTeam, Product, Team], :all
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/opponent/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="bg-[#FFF] border-[#FAE115] border-t-4 pb-2 justify-between">
<div class="flex justify-between border-[#FAE115] border-b-2 p-2">
<p class="p-2">
<%= opp.match_date.strftime("%d of %B, %Y") %>
<%= opp.match_date.strftime("%d of %b, %Y") %>
at
<%= opp.match_time.strftime("%I:%M %p") %>
|
Expand Down

0 comments on commit 8d6c764

Please sign in to comment.