Remove show action
This commit is contained in:
@@ -7,7 +7,6 @@ class HabitTracker.Routers.HabitsRouter extends Backbone.Router
|
||||
"/new" : "newHabit"
|
||||
"/index" : "index"
|
||||
"/:id/edit" : "edit"
|
||||
"/:id" : "show"
|
||||
".*" : "index"
|
||||
|
||||
newHabit: ->
|
||||
@@ -18,12 +17,6 @@ class HabitTracker.Routers.HabitsRouter extends Backbone.Router
|
||||
@view = new HabitTracker.Views.Habits.IndexView(habits: @habits)
|
||||
$("#habits").html(@view.render().el)
|
||||
|
||||
show: (id) ->
|
||||
habit = @habits.get(id)
|
||||
|
||||
@view = new HabitTracker.Views.Habits.ShowView(model: habit)
|
||||
$("#habits").html(@view.render().el)
|
||||
|
||||
edit: (id) ->
|
||||
habit = @habits.get(id)
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<%= name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Habit type:</b>
|
||||
<%= habit_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Score:</b>
|
||||
<%= score %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Notes:</b>
|
||||
<%= notes %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Up:</b>
|
||||
<%= up %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Down:</b>
|
||||
<%= down %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Done:</b>
|
||||
<%= done %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Position:</b>
|
||||
<%= position %>
|
||||
</p>
|
||||
|
||||
|
||||
<a href="#/index">Back</a>
|
||||
@@ -1,8 +0,0 @@
|
||||
HabitTracker.Views.Habits ||= {}
|
||||
|
||||
class HabitTracker.Views.Habits.ShowView extends Backbone.View
|
||||
template: JST["backbone/templates/habits/show"]
|
||||
|
||||
render: ->
|
||||
$(@el).html(@template(@model.toJSON() ))
|
||||
return this
|
||||
Reference in New Issue
Block a user