safely_back 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/safely_back.rb +16 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b6678db0733f58595f271a57b01c7f00ab871b24
4
+ data.tar.gz: 4fae8741ca28d45ab64bc0bbf607826963d909f0
5
+ SHA512:
6
+ metadata.gz: b55d918c4a680ef83f5f05a16dec7fe869cfdb2ba446203b7fdd9c37b3aefbe08e99ea3ff471eda1b4e4225d047c0e9988a96461ffcfd4d14eee02e34addbf13
7
+ data.tar.gz: aa81c808fd67c2ff71554834f4400fe804e37db1ab293dbb2de79a6dc3310979202cd81bb8242dbe02b379bb0c484b1957c079430ae04e32ab1dc76e8267d998
@@ -0,0 +1,16 @@
1
+ module ActionView
2
+ module Helpers
3
+ module UrlHelper
4
+ alias_method :_unsave_back_url, :_back_url
5
+
6
+ def _back_url
7
+ back_url = _unsave_back_url
8
+ begin URI.parse(back_url)
9
+ rescue Exception => e
10
+ back_url = 'javascript:history.back()'
11
+ end
12
+ back_url
13
+ end
14
+ end
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: safely_back
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cristiano Betta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Prevents link_to :back from including any non URLs as a href
14
+ email: cbetta@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/safely_back.rb
20
+ homepage: https://github.com/cbetta/safely_back
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Allows you to safely use link_to :back
44
+ test_files: []