twitter-bootstrap-helpers 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module TwitterBootstrapHelpers
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,7 +1,14 @@
1
1
  module TwitterBootstrapHelpers
2
2
  module ViewHelpers
3
- def icon_for(icon_name, string = '')
4
- content_tag(:i, '', :class => "icon-#{icon_name}") + string
3
+ def icon_for(icon_name, string = '', icon_position = :left)
4
+ classes = ["icon-#{icon_name}"]
5
+ if string.present?
6
+ classes << 'on-left' if icon_position == :left
7
+ classes << 'on-right' if icon_position == :right
8
+ end
9
+ icon = content_tag(:i, '', :class => classes)
10
+ html = (icon_position == :left) ? icon << string : string << icon
11
+ raw(html)
5
12
  end
6
13
 
7
14
  def alert_message(opts = {}, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-17 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A set of Ruby on Rails view helpers to be used with Twitter Bootstrap
15
15
  email: