Remove show action

This commit is contained in:
Tyler Renelle 2012-02-07 19:37:03 -05:00
parent d2fe179494
commit 34c1d5d46f
3 changed files with 0 additions and 57 deletions

View file

@ -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)

View file

@ -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>

View file

@ -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