dynamic-body-class-and-id 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +0 -0
  2. data/lib/dynamic-body-class-and-id.rb +10 -0
  3. metadata +81 -0
data/README ADDED
File without changes
@@ -0,0 +1,10 @@
1
+ module ApplicationHelper
2
+ # idea borrowed from http://www.fivesevensix.com/posts/2005/04/15/automatic-body-tag-id-with-rails
3
+ def body_id
4
+ controller ? controller.class.to_s.underscore.gsub(/_controller$/, '') : ""
5
+ end
6
+
7
+ def body_class
8
+ controller ? controller.action_name.underscore : ""
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dynamic-body-class-and-id
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Patrick Byrne
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-10 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: activesupport
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description:
36
+ email: code@patrickbyrne.net
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README
43
+ files:
44
+ - lib/dynamic-body-class-and-id.rb
45
+ - README
46
+ has_rdoc: true
47
+ homepage: http://bitbucket.org/pbyrne/dynamic-rails-body-class-and-id-gem/
48
+ licenses: []
49
+
50
+ post_install_message:
51
+ rdoc_options: []
52
+
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
73
+ requirements: []
74
+
75
+ rubyforge_project:
76
+ rubygems_version: 1.3.7
77
+ signing_key:
78
+ specification_version: 3
79
+ summary: The gem adds body_class and body_id helpers to your Rails app. The ID is based on the name of the controller and the class is based on the name of the action. Use this in your CSS to provide page-specific styles. For example, when accessing http://example.com/post/123, the body ID would be "post" and the class would be "show".
80
+ test_files: []
81
+