Skip to content
Snippets Groups Projects
Commit 301308f1 authored by Rysev, Gleb (UG - SISC)'s avatar Rysev, Gleb (UG - SISC)
Browse files

Removed unused habit routes

parent a1f4ff42
No related branches found
No related tags found
No related merge requests found
class HabitsController < ApplicationController class HabitsController < ApplicationController
before_action :set_habit, only: [:show, :edit, :update, :destroy, :track] before_action :set_habit, only: [:edit, :update, :destroy, :track]
before_action :user_check, only:[:show,:edit, :update, :destroy, :track] before_action :user_check, only:[:edit, :update, :destroy, :track]
# GET /habits or /habits.json
def index
@habits = Habit.all
end
# GET /habits/1 or /habits/1.json
def show
end
# GET /habits/new # GET /habits/new
def new def new
......
<p id="notice"><%= notice %></p>
<h1>Habits</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @habits.each do |habit| %>
<tr>
<td><%= link_to 'Show', habit %></td>
<td><%= link_to 'Edit', edit_habit_path(habit) %></td>
<td><%= link_to 'Destroy', habit, method: :delete, data: { confirm: t('confirm') } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Habit', new_habit_path %>
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_habit_path(@habit) %> |
<%= link_to 'Back', habits_path %>
json.partial! "habits/habit", habit: @habit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment