custom-template 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,7 +51,7 @@ class <%= controller_class_name %>Controller < ApplicationController
51
51
  if @<%= orm_instance.update_attributes(" #{singular_table_name} ") %>
52
52
  redirect_to( <%= singular_table_name %>_path( @<%= singular_table_name %> ), notice: <%= "\"#{human_name} was successfully updated.\"" %> )
53
53
  else
54
- render action: "edit", id: <%= "id" %>
54
+ render action: "edit"
55
55
  end
56
56
  end
57
57
 
@@ -59,8 +59,8 @@ class <%= controller_class_name %>Controller < ApplicationController
59
59
  # destroy #
60
60
  #---------#
61
61
  def destroy( id )
62
- @<%= singular_table_name %> = <%= "#{class_name}.where( id: id, user_id: session[:user_id] ).first" %>
63
- @<%= orm_instance.destroy %>
62
+ <%= singular_table_name %> = <%= "#{class_name}.where( id: id, user_id: session[:user_id] ).first" %>
63
+ <%= orm_instance.present? %> ? <%= orm_instance.destroy %> : <%= flash[:alert] %> = <%= "\"#{human_name} was successfully deleted.\"" %>
64
64
 
65
65
  redirect_to <%= plural_table_name %>_path
66
66
  end
@@ -1,5 +1,5 @@
1
1
  module Custom
2
2
  module Template
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom-template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-14 00:00:00.000000000 Z
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Custom Template for Scaffold.
15
15
  email: