inline_forms 0.9.20 → 0.9.21
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.9.
|
1
|
+
0.9.21
|
@@ -57,7 +57,7 @@ class InlineFormsController < ApplicationController
|
|
57
57
|
@PER_PAGE = 5 unless @parent_class.nil?
|
58
58
|
# if the parent_class is not nill, we are in associated list and we don't search there.
|
59
59
|
# also, make sure the Model that you want to do a search on has a :name attribute. TODO
|
60
|
-
@parent_class.nil? ? conditions = ["
|
60
|
+
@parent_class.nil? ? conditions = [ @Klass.order_by_clause.to_s + " like ?", "%#{params[:search]}%" ] : conditions = [ "#{@parent_class.foreign_key} = ?", @parent_id ]
|
61
61
|
if cancan_enabled?
|
62
62
|
@objects = @Klass.accessible_by(current_ability).order(@Klass.order_by_clause).paginate :page => params[:page], :per_page => @PER_PAGE || 12, :conditions => conditions
|
63
63
|
else
|
@@ -121,7 +121,7 @@ class InlineFormsController < ApplicationController
|
|
121
121
|
@parent_id = params[:parent_id]
|
122
122
|
@PER_PAGE = 5 unless @parent_class.nil?
|
123
123
|
# for the logic behind the :conditions see the #index method.
|
124
|
-
@parent_class.nil? ? conditions = ["
|
124
|
+
@parent_class.nil? ? conditions = [ @Klass.order_by_clause.to_s + " like ?", "%#{params[:search]}%" ] : conditions = [ "#{@parent_class.foreign_key} = ?", @parent_id ]
|
125
125
|
object[@parent_class.foreign_key] = @parent_id unless @parent_class.nil?
|
126
126
|
if object.save
|
127
127
|
flash.now[:success] = "Successfully created #{object.class.to_s.underscore}."
|
@@ -2,12 +2,12 @@ InlineForms::SPECIAL_COLUMN_TYPES[:date_select]=:date
|
|
2
2
|
|
3
3
|
# date
|
4
4
|
def date_select_show(object, attribute)
|
5
|
-
link_to_inline_edit object, attribute, object.send(attribute)
|
5
|
+
link_to_inline_edit object, attribute, object.send(attribute).strftime("%m-%d-%Y")
|
6
6
|
end
|
7
7
|
|
8
8
|
def date_select_edit(object, attribute)
|
9
9
|
css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s
|
10
|
-
out = text_field_tag attribute, object[attribute], :id => css_id
|
10
|
+
out = text_field_tag attribute, object[attribute].strftime("%m-%d-%Y"), :id => css_id
|
11
11
|
out << '<SCRIPT>'.html_safe
|
12
12
|
out << "$(function() { ".html_safe
|
13
13
|
out << '$("#'.html_safe + css_id.html_safe + '").datepicker();'.html_safe
|
data/inline_forms.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{inline_forms}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.21"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ace Suares"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-17}
|
13
13
|
s.description = %q{Inline Forms aims to ease the setup of forms that provide inline editing. The field list can be specified in the model.}
|
14
14
|
s.email = %q{ace@suares.an}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 21
|
10
|
+
version: 0.9.21
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ace Suares
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-17 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|