crud_menu 0.0.2 → 0.0.3

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.
@@ -8,8 +8,11 @@
8
8
  <li><%= delete_crud_link %></li>
9
9
  <li><%= close_crud_link %></li>
10
10
  <% end %>
11
- <% if action_called == 'edit' || action_called == 'new' %>
11
+ <% if action_called == 'edit' %>
12
12
  <li><%= cancel_crud_link %></li>
13
13
  <% end %>
14
+ <% if action_called == 'new' %>
15
+ <li><%= close_crud_link(true) %></li>
16
+ <% end %>
14
17
  </ul>
15
18
  </div>
@@ -1,3 +1,3 @@
1
1
  module CrudMenu
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -27,8 +27,10 @@ module CrudMenu
27
27
  def delete_crud_link
28
28
  link_to "Delete #{@controller.singularize.humanize}", @link_hash.merge({id: params[:id]}), method: :delete
29
29
  end
30
- def cancel_crud_link
31
- link_to "Cancel", @link_hash.merge({action: 'show', id: params[:id]})
30
+ def cancel_crud_link(new_page=false)
31
+ link_hash = @link_hash
32
+ link_hash.merge({action: 'show', id: params[:id]}) unless new_page
33
+ link_to "Cancel", link_hash)
32
34
  end
33
35
  def close_crud_link
34
36
  link_to "Close", @link_hash.merge({action: 'index'})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crud_menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: