inherited_resources_views 0.3.0 → 0.3.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inherited_resources_views}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Fred Wu"]
12
- s.date = %q{2010-08-11}
12
+ s.date = %q{2010-09-30}
13
13
  s.description = %q{Using Inherited Resources is an excellent way to reduce the amount of repetition in your controllers. But what about views? A lot of times resources share the same views, so why not DRY 'em up using Inherited Resources Views!}
14
14
  s.email = %q{ifredwu@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,5 +1,5 @@
1
1
  <table>
2
- <%- form_for(resource) do |f| %>
2
+ <%- form_for(resource, :url => resource.new_record? ? collection_url : resource_url(resource)) do |f| %>
3
3
  <% if resource.errors.any? %>
4
4
  <tr>
5
5
  <td colspan="2">
@@ -1,4 +1,4 @@
1
1
  <%= render "form" %>
2
2
 
3
- <p><%= link_to "Show", resource %></p>
4
- <p><%= link_to "Back", polymorphic_path(controller_name) %></p>
3
+ <p><%= link_to "Show", resource_url(resource) %></p>
4
+ <p><%= link_to "Back", collection_url %></p>
@@ -1,4 +1,4 @@
1
- <p><%= link_to "New", new_polymorphic_path(controller_name.singularize) %></p>
1
+ <p><%= link_to "New", new_resource_url %></p>
2
2
 
3
3
  <% if collection.any? %>
4
4
  <table>
@@ -15,9 +15,9 @@
15
15
  <% r.attributes.each do |a| %>
16
16
  <td><%= a[1] %></td>
17
17
  <% end %>
18
- <td><%= link_to "Show", r %></td>
19
- <td><%= link_to "Edit", edit_polymorphic_path(r) %></td>
20
- <td><%= link_to "Destroy", r, :confirm => 'Are you sure?', :method => :delete %></td>
18
+ <td><%= link_to "Show", resource_url(r) %></td>
19
+ <td><%= link_to "Edit", edit_resource_url(r) %></td>
20
+ <td><%= link_to "Destroy", resource_url(r), :confirm => 'Are you sure?', :method => :delete %></td>
21
21
  </tr>
22
22
  <% end %>
23
23
  </tbody>
@@ -1,3 +1,3 @@
1
1
  <%= render "form" %>
2
2
 
3
- <p><%= link_to "Back", polymorphic_path(controller_name) %></p>
3
+ <p><%= link_to "Back", collection_url %></p>
@@ -7,5 +7,5 @@
7
7
  <% end %>
8
8
  </table>
9
9
 
10
- <p><%= link_to "Edit", edit_polymorphic_path(resource) %></p>
11
- <p><%= link_to "Back", polymorphic_path(controller_name) %></p>
10
+ <p><%= link_to "Edit", edit_resource_url(resource) %></p>
11
+ <p><%= link_to "Back", collection_url %></p>
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Fred Wu
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-11 00:00:00 +10:00
17
+ date: 2010-09-30 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency