rails-ext 0.2.13 → 0.2.14

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/.git/index CHANGED
Binary file
data/.git/logs/HEAD CHANGED
@@ -27,3 +27,4 @@ fec19d13244f6b439e234e1af2e2e6d1f886b2fb 5f483b0c41645f8882f549c1c6d0274bb592140
27
27
  6496d7c4cc0c824e706bf757f9ec63b5553c9caf 4df726437dcbd106a583c07863e56076b245e8e3 alex <alex@amac.local> 1265293831 +0300 commit: upd
28
28
  4df726437dcbd106a583c07863e56076b245e8e3 a0d595c78f280787659a2a4400f5d63578b53dce alex <alex@amac.local> 1265749411 +0300 commit: upd
29
29
  a0d595c78f280787659a2a4400f5d63578b53dce e7e790ff7c580a636d0de69956834c9b47ad771b alex <alex@amac.local> 1266000303 +0300 commit: upd
30
+ e7e790ff7c580a636d0de69956834c9b47ad771b a59472e8ecb5d06647adeec11ae931b956508191 alex <alex@amac.local> 1266630067 +0300 commit: upd
@@ -27,3 +27,4 @@ fec19d13244f6b439e234e1af2e2e6d1f886b2fb 5f483b0c41645f8882f549c1c6d0274bb592140
27
27
  6496d7c4cc0c824e706bf757f9ec63b5553c9caf 4df726437dcbd106a583c07863e56076b245e8e3 alex <alex@amac.local> 1265293831 +0300 commit: upd
28
28
  4df726437dcbd106a583c07863e56076b245e8e3 a0d595c78f280787659a2a4400f5d63578b53dce alex <alex@amac.local> 1265749411 +0300 commit: upd
29
29
  a0d595c78f280787659a2a4400f5d63578b53dce e7e790ff7c580a636d0de69956834c9b47ad771b alex <alex@amac.local> 1266000303 +0300 commit: upd
30
+ e7e790ff7c580a636d0de69956834c9b47ad771b a59472e8ecb5d06647adeec11ae931b956508191 alex <alex@amac.local> 1266630067 +0300 commit: upd
@@ -25,3 +25,4 @@ fec19d13244f6b439e234e1af2e2e6d1f886b2fb 5f483b0c41645f8882f549c1c6d0274bb592140
25
25
  0daa3468e187093eff222b8094a6e702dea9ba4e 4df726437dcbd106a583c07863e56076b245e8e3 alex <alex@amac.local> 1265293841 +0300 update by push
26
26
  4df726437dcbd106a583c07863e56076b245e8e3 a0d595c78f280787659a2a4400f5d63578b53dce alex <alex@amac.local> 1265749416 +0300 update by push
27
27
  a0d595c78f280787659a2a4400f5d63578b53dce e7e790ff7c580a636d0de69956834c9b47ad771b alex <alex@amac.local> 1266000307 +0300 update by push
28
+ e7e790ff7c580a636d0de69956834c9b47ad771b a59472e8ecb5d06647adeec11ae931b956508191 alex <alex@amac.local> 1266630072 +0300 update by push
@@ -1 +1 @@
1
- e7e790ff7c580a636d0de69956834c9b47ad771b
1
+ a59472e8ecb5d06647adeec11ae931b956508191
@@ -1 +1 @@
1
- e7e790ff7c580a636d0de69956834c9b47ad771b
1
+ a59472e8ecb5d06647adeec11ae931b956508191
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ require 'fileutils'
18
18
 
19
19
  spec = Gem::Specification.new do |s|
20
20
  s.name = "rails-ext"
21
- s.version = "0.2.13"
21
+ s.version = "0.2.14"
22
22
  s.summary = "Set of common Ruby on Rails extensions"
23
23
  s.description = "Set of common Ruby on Rails extensions"
24
24
  s.author = "Alexey Petrushin"
@@ -3,29 +3,57 @@
3
3
  #
4
4
  ActionController::Base.class_eval do
5
5
  protected
6
- def url_for_path path, options = {}
7
- unless options.delete :no_prefix
8
- url = ActionController::Base.relative_url_root + path
9
- else
10
- url = path
6
+ #
7
+ # Bunch of small actions
8
+ #
9
+ def render_action action
10
+ @the_action = action
11
+
12
+ render :actions
13
+ # @inline_js = js
14
+ # render :template => 'layouts/application'
11
15
  end
12
- options = options.merge default_url_options
13
- url << "?#{options.to_query}" unless options.empty?
14
- url._url_format = options[:format] if options[:format] # for links with ajax support
15
- url
16
- end
16
+
17
+ def the_action; @the_action end
18
+ helper_method :the_action
19
+
20
+
17
21
 
18
- def catch_user_error
19
- begin
20
- yield
21
- rescue UserError => e
22
- flash[:error] = e.message
23
- do_not_persist_params do
24
- redirect_to default_path
22
+ #
23
+ # Url from String Path
24
+ #
25
+ def url_for_path path, options = {}
26
+ unless options.delete :no_prefix
27
+ url = ActionController::Base.relative_url_root + path
28
+ else
29
+ url = path
25
30
  end
31
+ options = options.merge default_url_options
32
+ url << "?#{options.to_query}" unless options.empty?
33
+ url._url_format = options[:format] if options[:format] # for links with ajax support
34
+ url
26
35
  end
27
- end
28
- around_filter :catch_user_error
36
+ helper_method :url_for_path
37
+
38
+
39
+ #
40
+ # User Error
41
+ #
42
+ def catch_user_error
43
+ begin
44
+ yield
45
+ rescue UserError => e
46
+ flash[:error] = e.message
47
+ do_not_persist_params do
48
+ if request.xhr?
49
+ render :inline => "", :layout => 'application'
50
+ else
51
+ redirect_to default_path
52
+ end
53
+ end
54
+ end
55
+ end
56
+ around_filter :catch_user_error
29
57
 
30
58
  class << self
31
59
  def prepare_model aclass, opt = {}
@@ -1 +1,2 @@
1
- .hidden{display: none;}
1
+ .hidden{display: none;}
2
+ .todo{background: #ffa;}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Petrushin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-12 00:00:00 +03:00
12
+ date: 2010-02-20 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -130,6 +130,7 @@ files:
130
130
  - .git/objects/59/0ef6ba9931d75fbddc7a940044dbaaa50efc76
131
131
  - .git/objects/59/7b19d2ba6f1d46f75f702cbacf8828b7b506f9
132
132
  - .git/objects/5a/35fa85474278f3c817aa59d07b725428c41a28
133
+ - .git/objects/5c/d7e89f2b29ed92fd51e2c6b2ee74db376d17d7
133
134
  - .git/objects/5f/483b0c41645f8882f549c1c6d0274bb592140a
134
135
  - .git/objects/60/a681e873ca0ae0b7da3f37dbc5701f6e42b970
135
136
  - .git/objects/61/16fb26eb219d3ac6926221d57a0342aa2a8d56
@@ -154,6 +155,7 @@ files:
154
155
  - .git/objects/76/d3cd0f31cfb174c2411be5636a8257e7af613a
155
156
  - .git/objects/77/6e03ab9139aab1e0e8d551a75c3c0145fd9322
156
157
  - .git/objects/79/0a80b72f6f6f214ece6a3e71e818effc5c9e6e
158
+ - .git/objects/7a/d62f1e2a8e4af39d293ce70c5dca999263ab4e
157
159
  - .git/objects/7d/156826045e2eef7611f3fcad3adee9c17c2c02
158
160
  - .git/objects/7d/6cd855bdf8661fab653f9f2de1195a6552e458
159
161
  - .git/objects/7d/978ee312ca2119dc84e40431182b8f68e42f53
@@ -161,6 +163,7 @@ files:
161
163
  - .git/objects/81/156e1461b12b90f0dc2604458317ca8f5d45c0
162
164
  - .git/objects/81/d4aa3b627dfc7397ce3f71577a8307324b8289
163
165
  - .git/objects/82/03c2c6cdd29e1e20e88fbb81e63b7ea1ec2899
166
+ - .git/objects/83/6f33959bcf517b9952aefb3fdfdd7ff3c1f207
164
167
  - .git/objects/85/eee9f4c1a6f710ed87bf28a0531275777f8848
165
168
  - .git/objects/86/b31b604469e9b261f4e5b927932504bca8c402
166
169
  - .git/objects/87/fc827fd223cac6b4e55d823a9ea86bb0726a3b
@@ -168,6 +171,7 @@ files:
168
171
  - .git/objects/8b/7fd3b87e0f2fce82705c50e7c48f9496b7666e
169
172
  - .git/objects/8c/4648d7c914e9d60dc387ff801c97b2d19c97f7
170
173
  - .git/objects/8d/4dcde8df4da8f53f5f5313757b907e9aa1af66
174
+ - .git/objects/8e/3cfb391de711b5fecfbdf2860fa37b019e8036
171
175
  - .git/objects/8e/69b6cf3ec8b49270091b4a206ccf326679dc20
172
176
  - .git/objects/90/ca84ea326afab5fcc92a50469c2052ebc46f11
173
177
  - .git/objects/92/e1c250edfca72ed0932934257ef3cfc7122ec5
@@ -185,9 +189,12 @@ files:
185
189
  - .git/objects/a3/5c311b625d863b50d51e2385259d487e277c90
186
190
  - .git/objects/a3/6956ff51b72b69d1ac2c1ad0d78bb9ad1ade75
187
191
  - .git/objects/a5/4db1bec30f7dc8981c4d5ccf9c9a90c1e13662
192
+ - .git/objects/a5/9472e8ecb5d06647adeec11ae931b956508191
193
+ - .git/objects/a6/438da91846df9ac940b59f6d11d5019a5580be
188
194
  - .git/objects/a7/6c4944dc009628cb65b4962464a8eb484d6a71
189
195
  - .git/objects/a7/a902aeac4af3f10b474c23c2a3750fde007a02
190
196
  - .git/objects/a9/d2b84a743094002fef87a193e681ee721d76ed
197
+ - .git/objects/ab/825cde00e626431c6045e6886d470327c63001
191
198
  - .git/objects/ac/92bcf6c74d23824c3c7ce341f667507592c7f9
192
199
  - .git/objects/ac/a1ad63cec98e0b3dae23fbe088f5a5d2125a7a
193
200
  - .git/objects/ae/536c345aad67cee8ce167dc91006263e63885f
@@ -245,6 +252,7 @@ files:
245
252
  - .git/objects/e3/cde2715e3e3870a5d7312cac9bbf6e24259e0f
246
253
  - .git/objects/e4/1d46e33f52e07b836b966d58677fc2a864a4a4
247
254
  - .git/objects/e4/d7cacac2d7e66df5a7c21eaae71c0a90f1439d
255
+ - .git/objects/e5/7fa5fd7f10f6f532742b0cc2dc3edaed6c0763
248
256
  - .git/objects/e6/ed7d272f8c48a28904007d653837bfe761be36
249
257
  - .git/objects/e7/e790ff7c580a636d0de69956834c9b47ad771b
250
258
  - .git/objects/e7/f4b26a3258b7788ffe2665773387e19c01095a
@@ -270,6 +278,7 @@ files:
270
278
  - .git/objects/f9/ef6dd08a60dec5d5e4e7a9b08f693ebf76da39
271
279
  - .git/objects/fa/4e345a8b9a12bf1cf7af254b3caa111b04191b
272
280
  - .git/objects/fb/05e1cc9825c59c7edc596c05077a1eed9c321e
281
+ - .git/objects/fd/25e0c8e44fb97a7c7d76280cec51886b51abf6
273
282
  - .git/objects/fe/c19d13244f6b439e234e1af2e2e6d1f886b2fb
274
283
  - .git/objects/fe/ce95626cedcc0682e6fcc20fe019aab60938f2
275
284
  - .git/objects/pack/pack-c7edd4d292858ed6a37a55c1b6ceb35f65f4587e.idx