acts_as_multipart_form 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/README.rdoc +3 -1
- data/VERSION +1 -1
- data/acts_as_multipart_form.gemspec +1 -1
- data/app/views/multipart_form/_index_links.html.erb +5 -4
- data/lib/acts_as_multipart_form/multipart_form_in_controller.rb +2 -2
- data/lib/generators/acts_as_multipart_form/templates/migrations/install_migration.rb.erb +2 -0
- data/spec/dummy/app/views/people/index.html.erb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
== unreleased changes
|
2
|
+
|
3
|
+
== 0.0.6
|
4
|
+
|
5
|
+
* Added indices to the migration
|
6
|
+
* Updated the controller mixin to do a better job handling namespaced models
|
7
|
+
* Clarified how the route needs to be setup in the readme
|
8
|
+
* Changed the ordering of the default form partial in the controller mixin
|
9
|
+
* Updated index links partial to not use the locals hash directly
|
10
|
+
|
1
11
|
== 0.0.5
|
2
12
|
|
3
13
|
* Updated gem requirements
|
data/README.rdoc
CHANGED
@@ -20,7 +20,9 @@ The parts correspond to methods in the controller and partials in the controller
|
|
20
20
|
|
21
21
|
Each form has a polymorphic relationship with a single record. This relationship is specified by the model key's value. This is how the form is loaded on the index page and the only association it has with the rest of the system.
|
22
22
|
|
23
|
-
Two routes can be specified for the form system. The form route corresponds to the route to the form itself. It's default value is model_name_form_name. In the example, the specified value would be the default value. The show route, specified with the tag :show_route is redirected to after the last part of the multipart form is submitted and passes validations. It
|
23
|
+
Two routes can be specified for the form system. The form route corresponds to the route to the form itself. It's default value is model_name_form_name. In the example, the specified value would be the default value. The show route, specified with the tag :show_route is redirected to after the last part of the multipart form is submitted and passes validations. It defaults to model_name to correspond with the model's view page.
|
24
|
+
|
25
|
+
Note that when you add the route to your route file, it must be able to match both get and post requests.
|
24
26
|
|
25
27
|
== Add the mixin to your model
|
26
28
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "acts_as_multipart_form"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeremiah Hemphill", "Ethan Pemble"]
|
@@ -1,16 +1,17 @@
|
|
1
1
|
<div class='multipart_form_index_links'>
|
2
2
|
<div class='multipart_form_index_links_links'>
|
3
|
-
<%
|
3
|
+
<% debugger %>
|
4
|
+
<% @multipart_form_index_parts[form_subject.id][:parts].each do |part| %>
|
4
5
|
<% if ActsAsMultipartForm.config.use_numbered_parts_on_index %>
|
5
|
-
<%= link_to part[:number].to_s, send(@multipart_form_path, :id =>
|
6
|
+
<%= link_to part[:number].to_s, send(@multipart_form_path, :id => form_subject.id, :multipart_form_part => part[:name]) %>
|
6
7
|
<% else %>
|
7
|
-
<%= link_to part[:name].to_s.titleize, send(@multipart_form_path, :id =>
|
8
|
+
<%= link_to part[:name].to_s.titleize, send(@multipart_form_path, :id => form_subject.id, :multipart_form_part => part[:name]) %>
|
8
9
|
<% end %>
|
9
10
|
<% end %>
|
10
11
|
</div>
|
11
12
|
<% if ActsAsMultipartForm.config.show_completed %>
|
12
13
|
<div class='multipart_form_index_links_complete'>
|
13
|
-
<% if @multipart_form_index_parts[
|
14
|
+
<% if @multipart_form_index_parts[form_subject.id][:completed] %>
|
14
15
|
Complete
|
15
16
|
<% else %>
|
16
17
|
Incomplete
|
@@ -67,8 +67,8 @@ module ActsAsMultipartForm
|
|
67
67
|
end
|
68
68
|
# sets default model if it is not set
|
69
69
|
arg[:model] = self.to_s.gsub("Controller", "").singularize unless arg.has_key?(:model)
|
70
|
-
arg[:form_route] = (arg[:
|
71
|
-
arg[:show_route] = (arg[:model].
|
70
|
+
arg[:form_route] = (arg[:name].to_s + "_" + arg[:model].gsub("::", "").underscore) unless arg.has_key?(:form_route)
|
71
|
+
arg[:show_route] = (arg[:model].gsub("::", "").underscore) unless arg.has_key?(:show_route)
|
72
72
|
# copy args to fields
|
73
73
|
self.multipart_forms[arg[:name]] = arg
|
74
74
|
forms << arg[:name]
|
@@ -9,6 +9,8 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|
9
9
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
|
+
add_index :multipart_form_in_progress_forms, [:form_subject_type, :form_subject_id], :name => "multipart_form_ipf_form_subject"
|
13
|
+
add_index :multipart_form_in_progress_forms, :form_name
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.down
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<td><%= person.id %></td>
|
10
10
|
<td><%= person.name %></td>
|
11
11
|
<td>
|
12
|
-
<%= render "multipart_form/index_links", :locals => {:form_subject => person } %>
|
12
|
+
<%= render :partial => "multipart_form/index_links", :locals => {:form_subject => person } %>
|
13
13
|
</td>
|
14
14
|
</tr>
|
15
15
|
<% end %>
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: acts_as_multipart_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jeremiah Hemphill
|
@@ -257,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
257
|
requirements:
|
258
258
|
- - ">="
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
hash:
|
260
|
+
hash: 3542899139585014364
|
261
261
|
segments:
|
262
262
|
- 0
|
263
263
|
version: "0"
|