jqr-helpers 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/jqr-helpers.gemspec +1 -1
- data/lib/jqr-helpers/helpers.rb +9 -8
- data/lib/jqr-helpers/version.rb +1 -1
- metadata +1 -1
data/jqr-helpers.gemspec
CHANGED
data/lib/jqr-helpers/helpers.rb
CHANGED
@@ -29,7 +29,7 @@ module JqrHelpers
|
|
29
29
|
else
|
30
30
|
options = url_or_options
|
31
31
|
content = yield
|
32
|
-
id = _random_string
|
32
|
+
id = Helpers._random_string
|
33
33
|
url = '#' + id
|
34
34
|
end
|
35
35
|
options.merge!(:id => id)
|
@@ -138,7 +138,8 @@ module JqrHelpers
|
|
138
138
|
end
|
139
139
|
|
140
140
|
html_options[:'data-dialog-url'] = url
|
141
|
-
link_to_dialog(_random_string, html_content,
|
141
|
+
link_to_dialog(Helpers._random_string, html_content,
|
142
|
+
dialog_options, html_options)
|
142
143
|
end
|
143
144
|
|
144
145
|
# Same as button_to_dialog, but loads content from a remote URL instead of
|
@@ -298,6 +299,12 @@ module JqrHelpers
|
|
298
299
|
content_tag(:div, raw(content), html_options)
|
299
300
|
end
|
300
301
|
|
302
|
+
# Generate a random string for IDs.
|
303
|
+
# @return [String]
|
304
|
+
def self._random_string
|
305
|
+
SecureRandom.hex(16)
|
306
|
+
end
|
307
|
+
|
301
308
|
private
|
302
309
|
|
303
310
|
# @param format [String] the Rails date format to map
|
@@ -342,12 +349,6 @@ module JqrHelpers
|
|
342
349
|
|
343
350
|
end
|
344
351
|
|
345
|
-
# Generate a random string for IDs.
|
346
|
-
# @return [String]
|
347
|
-
def _random_string
|
348
|
-
SecureRandom.hex(16)
|
349
|
-
end
|
350
|
-
|
351
352
|
# Process options related to Ajax requests (e.g. button_to_ajax).
|
352
353
|
# @param options [Hash]
|
353
354
|
# @return [Hash] HTML options to inject.
|
data/lib/jqr-helpers/version.rb
CHANGED