Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #164 from MyDry/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rkdora authored Nov 15, 2018
2 parents a937dfc + c5c89a6 commit 1c6005c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/words_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create
end

def destroy
@word = Word.find_by(params[:id])
@word = Word.find(params[:id])
@word.destroy
flash[:success] = "単語を削除しました"
redirect_to words_path
Expand Down
4 changes: 1 addition & 3 deletions app/views/words/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
</div>
<div class="words-index">
<% @words.each do |word| %>
<%= word.id %>.
<%= word.word %>
<% if current_user.admin? %>
<%= link_to "delete", word_path(word), method: :delete, data: {confirm: "You sure?"} %>
<% end %>
<br>
<% end %>   
<% end %>
</div>
</div>
Expand Down

0 comments on commit 1c6005c

Please sign in to comment.