crudify 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crudify (0.1.0.beta)
4
+ crudify (0.0.5)
5
5
  meta_search (>= 1.0.1)
6
6
  rails (>= 3.0.0)
7
7
  will_paginate (>= 2.3.15)
@@ -102,7 +102,7 @@ GEM
102
102
  thor (0.14.6)
103
103
  treetop (1.4.9)
104
104
  polyglot (>= 0.3.1)
105
- tzinfo (0.3.24)
105
+ tzinfo (0.3.25)
106
106
  will_paginate (2.3.15)
107
107
  xpath (0.1.3)
108
108
  nokogiri (~> 1.3)
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2005-2010 [Resolve Digital](http://www.resolvedigital.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -132,4 +132,26 @@ To Do
132
132
  License
133
133
  -------
134
134
 
135
- Copyright (c) 2011 Spencer Steffen, released under the New BSD License All rights reserved.
135
+ Crudify is released under [Resolve Digital](http://www.resolvedigital.com)'s original license since portions of the code was extracted from [refinerycms](http://github.com/resolve/refinerycms).
136
+
137
+ ### MIT License
138
+
139
+ Copyright (c) 2005-2010 [Resolve Digital](http://www.resolvedigital.com)
140
+
141
+ Permission is hereby granted, free of charge, to any person obtaining a copy
142
+ of this software and associated documentation files (the "Software"), to deal
143
+ in the Software without restriction, including without limitation the rights
144
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
+ copies of the Software, and to permit persons to whom the Software is
146
+ furnished to do so, subject to the following conditions:
147
+
148
+ The above copyright notice and this permission notice shall be included in all
149
+ copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
+ SOFTWARE.
@@ -80,6 +80,7 @@ module Crudify
80
80
 
81
81
  def destroy
82
82
  before_destroy
83
+ set_what
83
84
  # object gets found by find_#{singular_name} function
84
85
  if @#{singular_name}.destroy
85
86
  successful_destroy
@@ -105,8 +106,6 @@ module Crudify
105
106
  ).order("#{options[:order]}")
106
107
  end
107
108
 
108
-
109
-
110
109
 
111
110
  # Finds one single result based on the id params.
112
111
  def find_#{singular_name}
@@ -165,7 +164,7 @@ module Crudify
165
164
  if options[:paginate]
166
165
  module_eval %(
167
166
  def index
168
- search_all_#{plural_name} if searching?
167
+ search_all_#{plural_name}
169
168
  paginate_all_#{plural_name}
170
169
  end
171
170
  )
@@ -19,7 +19,6 @@ module Crudify
19
19
  def before_destroy
20
20
  # just a hook!
21
21
  puts "> Crud::before_destroy" if @crud_options[:log]
22
- set_what
23
22
  before_action
24
23
  end
25
24
 
@@ -62,7 +61,7 @@ module Crudify
62
61
  redirect_to @redirect_to_url
63
62
  elsif params[:commit].to_s.match(/continue/)
64
63
  if params[:action] == 'create'
65
- redirect_to request.referer.sub('new', "#{@what.to_param}/edit")
64
+ redirect_to request.referer.sub(/(\/?(new)?\/?)$/, '') + "/#{@instance.to_param}"
66
65
  else
67
66
  redirect_to request.referer
68
67
  end
@@ -106,7 +105,7 @@ module Crudify
106
105
  unless request.xhr?
107
106
  render :action => request.post? ? 'new' : 'edit'
108
107
  else
109
- flash[:error] = [flash[:error], @what.errors.collect{|key,value| "#{key} #{value}"}.join("<br/>")]
108
+ flash[:error] = [flash[:error], @instance.errors.collect{|key,value| "#{key} #{value}"}.join("<br/>")]
110
109
  render :partial => "/shared/message"
111
110
  end
112
111
  end
@@ -1,3 +1,3 @@
1
1
  module Crudify
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -21,3 +21,32 @@
21
21
  <br/>
22
22
  <p>So much jelly, <strike>so little time</strike> and time to eat it too.</p>
23
23
  <% end %>
24
+
25
+ <hr/>
26
+
27
+ <h3>Search for Jellies?</h3>
28
+ <p><em>Yeah, it does that too using <%= link_to "meta_search", "https://github.com/ernie/meta_search" %>.</em></p>
29
+
30
+ <%= form_for @search, :html => {:method => :get} do |f| %>
31
+ <p>
32
+ <%= f.label :title_contains, 'Title:' %>
33
+ <%= f.text_field :title_contains %>
34
+ </p>
35
+ <p>
36
+ <%= f.label :name_contains, 'Name:' %>
37
+ <%= f.text_field :name_contains %>
38
+ </p>
39
+ <p class="action">
40
+ <%= f.submit 'Search' %>
41
+ </p>
42
+ <% end %>
43
+ <hr/>
44
+ <!--
45
+
46
+ <h3>And sorting?</h3>
47
+ <p><em>Yep, just set it as an option.</p>
48
+
49
+ <pre>
50
+ # todo
51
+ </pre>
52
+ -->
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: crudify
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Spencer Steffen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-05 00:00:00 -08:00
13
+ date: 2011-03-16 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -103,6 +103,7 @@ files:
103
103
  - .gitignore
104
104
  - Gemfile
105
105
  - Gemfile.lock
106
+ - LICENSE.md
106
107
  - README.md
107
108
  - Rakefile
108
109
  - config/locales/en.yml
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  requirements: []
191
192
 
192
193
  rubyforge_project:
193
- rubygems_version: 1.6.0
194
+ rubygems_version: 1.6.2
194
195
  signing_key:
195
196
  specification_version: 3
196
197
  summary: Crudify is a dynamic resource controller for Rails 3.