mappable 0.0.4 → 0.0.5

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.
@@ -1,4 +1,4 @@
1
- <%= form_for(@mapping, url: mappings_path(subject: @mapping.parent_map.subject, attr: @mapping.parent_map.attr.pluralize)) do |f| %>
1
+ <%= form_for(@mapping) do |f| %>
2
2
  <% if @mapping.errors.any? %>
3
3
  <div id="error_explanation">
4
4
  <h2><%= pluralize(@mapping.errors.count, "error") %> prohibited this mapping from being saved:</h2>
@@ -21,6 +21,7 @@
21
21
  </div>
22
22
  <%= f.hidden_field :map_id %>
23
23
  <div class="actions">
24
- <%= f.submit %>
24
+ <% label = @mapping.new_record? ? "Create Mapping" : "Update Mapping" %>
25
+ <%= f.submit label %>
25
26
  </div>
26
27
  <% end %>
@@ -14,10 +14,8 @@
14
14
  <td><%= mapping.from %></td>
15
15
  <td><%= mapping.to %></td>
16
16
  <td><%= link_to 'Show', mapping_path(mapping, subject: @map.subject, attr: @map.attr.pluralize) %></td>
17
- <td><%= link_to 'Edit', edit_mapping_path(mapping) %></td>
18
- <td><%= link_to 'Destroy', mapping_path(mapping, subject: @map.subject, attr: @map.attr.pluralize), confirm: 'Are you sure?', method: :delete %></td>
19
- </tr>
20
- <% end %>
17
+ <td><%= link_to 'Edit', edit_mapping_path(mapping, subject: @map.subject, attr: @map.attr.pluralize) %></td>
18
+ <td><%= link_to 'Destroy', mapping_path(mapping, subject: @map.subject, attr: @map.attr.pluralize), confirm: 'Are you sure?', method: :delete %></td><% end %>
21
19
  </table>
22
20
 
23
21
  <br />
@@ -1,4 +1,4 @@
1
- <h1>Edit <%= @map.subject.humanize.titleize %> <%= @map.attr.humanize.titleize %> Mappings</h1>
1
+ <h1>Edit <%= @mapping.map.subject.humanize.titleize %> <%= @mapping.map.attr.humanize.titleize %> Mappings</h1>
2
2
 
3
3
  <p>
4
4
  <b>Map:</b>
@@ -17,7 +17,7 @@
17
17
  <td><%= map.attr %></td>
18
18
  <td><%= map.from %></td>
19
19
  <td><%= map.to %></td>
20
- <td><%= link_to 'Show', map %></td>
20
+ <td><%= link_to 'Show', mappings_path(subject: map.subject, attr: map.attr.pluralize) %></td>
21
21
  <td><%= link_to 'Edit', edit_map_path(map) %></td>
22
22
  <td><%= link_to 'Destroy', map, confirm: 'Are you sure?', method: :delete %></td>
23
23
  </tr>
data/config/routes.rb CHANGED
@@ -21,5 +21,18 @@ Mappable::Engine.routes.draw do
21
21
  as: 'mapping',
22
22
  via: 'get'
23
23
 
24
- resources :mappings, only: [:edit, :destroy]
24
+ match "/:subject/:attr/:id/edit",
25
+ to: 'mappings#edit',
26
+ as: 'edit_mapping',
27
+ via: 'get'
28
+
29
+ match "/:subject/:attr/:id",
30
+ to: 'mappings#update',
31
+ as: 'mapping',
32
+ via: 'put'
33
+
34
+ match "/:subject/:attr/:id",
35
+ to: 'mappings#destroy',
36
+ as: 'mapping',
37
+ via: 'delete'
25
38
  end
@@ -1,3 +1,3 @@
1
1
  module Mappable
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mappable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-30 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70211475888860 !ruby/object:Gem::Requirement
16
+ requirement: &70188236597900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70211475888860
24
+ version_requirements: *70188236597900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &70211475888280 !ruby/object:Gem::Requirement
27
+ requirement: &70188236597360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.4
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70211475888280
35
+ version_requirements: *70188236597360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &70211475887740 !ruby/object:Gem::Requirement
38
+ requirement: &70188236596900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.6.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70211475887740
46
+ version_requirements: *70188236596900
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: capybara
49
- requirement: &70211475887280 !ruby/object:Gem::Requirement
49
+ requirement: &70188236596420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.1.1
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70211475887280
57
+ version_requirements: *70188236596420
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &70211475886720 !ruby/object:Gem::Requirement
60
+ requirement: &70188236595940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.10.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70211475886720
68
+ version_requirements: *70188236595940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: launchy
71
- requirement: &70211475886260 !ruby/object:Gem::Requirement
71
+ requirement: &70188236595480 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 2.0.5
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70211475886260
79
+ version_requirements: *70188236595480
80
80
  description: Lightweight string mappings engine for Rails
81
81
  email:
82
82
  - mikebannister@gmail.com
@@ -137,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  segments:
139
139
  - 0
140
- hash: -719282748366311490
140
+ hash: -2016495543354355232
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  none: false
143
143
  requirements:
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -719282748366311490
149
+ hash: -2016495543354355232
150
150
  requirements: []
151
151
  rubyforge_project:
152
152
  rubygems_version: 1.8.10