slugable-joe 0.0.1 → 0.0.2

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 +8 -8
  2. data/lib/slugable.rb +18 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWE2OGZhYmRhY2YxMTAyMzgzZjRjYWUxZGY1NjE0NTQ2MTcyMzYyYg==
4
+ ZTY2MTA5N2FiZmI5Y2ZhOWVkOWI0Y2YyZTgyNmRkNmFkYTIxMWZiYg==
5
5
  data.tar.gz: !binary |-
6
- NzM5MTczMzdlMWY3OTk2ZGE2MGRmYjI0NmZkOTQyM2FjNTA2M2M3Mg==
6
+ MGExZjgzMjRlODg2NTk3OGViYWEyNjEyNzUxN2JiZWQzNjQxMmM4ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTBlZTk0MTQzMTRkMTUyNTliZWZmMWQxMjkzMDAwMGRjZjg1M2M2MTE2MDJj
10
- MTNmOTNjMWNkNmE5M2E4MGQxNzhlYjc5MzcxYzYzOWJlNmY4MjY0OWYzN2E2
11
- YTZlOTU2ZTk5Y2RiZTRjMGRhMmE3M2NlZTEyMThhMTBlODBmMjA=
9
+ MWUyNWRhNGM1NmI1ZDc4OWQ5YmJjNjQ5MTk5NjI2MDIxYmMzZTc1NTUzYTAw
10
+ MzQxMzBiYmU5YTg0NzE0MTc2OTg1ZjUxYWQ0ZGNkN2QzY2UxMjE3MzdmYzNk
11
+ YTFkZmI1ZDU2ZmMzOTQzN2JiMDljZDRiNzcxNWUzZjlmYThhMDA=
12
12
  data.tar.gz: !binary |-
13
- NTRhZjYzYzNmMGVhYThhMWEwMTdiYjIxZWQwM2UwYTgyOWVhMGZkMTk2NTQ1
14
- YTZiMDVkMDMxZGYzZGM5M2VlYzU3YmMzMmRkZjQ5Yjg2ZWJhOTZkMWZkMDNl
15
- NGM4ZTg1MmI1MWQ2OGJlNDZkOGIxZGRkMTMxZDJjNmFjZDEwMzE=
13
+ NTZmNDQyMWIwNTgxNjVjM2ExNGQ3MjFiYWE0NGIyZWE4ODUwOWZiYTdkMDhh
14
+ NGM4YmNlZWNkYWRkOGIzZjQyYTZmMjQyNWQ2YmM2ODM1ODVmOTgxOTVjNGIw
15
+ NzlkMjlmNWRiZmQ2M2M0ODQ4ZjU4NzBjMDczYjAzYzk4YjMxNzk=
data/lib/slugable.rb CHANGED
@@ -1,7 +1,23 @@
1
1
  # Note:
2
- # This gem requires that you specify the :slug_string using alias_attribute. So, for example, if the slug that you are creating
3
- # will be based on the :title in your model, you would need to include the following line of code within the file that is invoking the gem:
2
+ #
3
+ # You will need to include three items in your code in order for the gem to work properly:
4
+ #
5
+ # (1) Specify the :slug_string using the alias_attribute method. So, for example, if the
6
+ # slug that you are creating will be based on the :title in your model, you will need to
7
+ # include the following line of code within the file that is invoking the gem:
4
8
  # alias_attribute :slug_string, :title
9
+ #
10
+ # (2) You will need to include a to_param method, in order to generate the slug, as follows:
11
+ #
12
+ # def to_param
13
+ # self.slug
14
+ # end
15
+ #
16
+ # You can then reference to_param in your view to print out the URL containing the slug.
17
+ #
18
+ # (3) You will want to use the before_save ActiveRecord Callback, as follows:
19
+ #
20
+ # before_save :generate_slug
5
21
 
6
22
  module Slugable
7
23
  def generate_slug
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slugable-joe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Levinger