From e7ffb850d5dddba8b62bac351e040d1fdfade7c7 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 19 Oct 2014 16:16:55 +0200 Subject: [PATCH] calentry edit --- app/controllers/calentries_controller.rb | 10 ++++++---- app/views/calentries/_calentry.html.erb | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/calentries_controller.rb b/app/controllers/calentries_controller.rb index 6b488e1..7bb1c07 100644 --- a/app/controllers/calentries_controller.rb +++ b/app/controllers/calentries_controller.rb @@ -35,10 +35,12 @@ class CalentriesController < ApplicationController # end # GET /calentries/1/edit - #def edit - # @calentry = Calentry.find(params[:id]) - - # end + def edit + @calentry = Calentry.find(params[:id]) + respond_to do |format| + format.html + end + end # POST /calentries # POST /calentries.json diff --git a/app/views/calentries/_calentry.html.erb b/app/views/calentries/_calentry.html.erb index a187212..94e45e5 100644 --- a/app/views/calentries/_calentry.html.erb +++ b/app/views/calentries/_calentry.html.erb @@ -1,4 +1,4 @@ -
+
<% image_tag("/iconnavy/time.png") %> <%= fa_icon("calendar 2x") %> @@ -9,5 +9,5 @@ format =:default end%> <%= calentry.text %> - +<%= link_to "edit", edit_calentry_path(calentry) if can? :edit, calentry %>