helper_methods 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -29,6 +29,7 @@ Included helpers:
29
29
  icon('th-large icon-white')
30
30
  active_link_to 'some string', some_path
31
31
  attachment_url file, :style # return full url for attachment
32
+ full_url_for resource
32
33
  qr_code_for 'url', 'size in pixels'
33
34
 
34
35
  ### Youtube helpers
@@ -1,3 +1,3 @@
1
1
  module HelperMethods
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
@@ -65,7 +65,7 @@ module HelperMethods
65
65
  request.user_agent =~ /Mobile|webOS/
66
66
  end
67
67
 
68
- def youtube(video, width = 580, height = 420)
68
+ def youtube_videop(video, width = 580, height = 420)
69
69
  "<iframe width='#{width}' height='#{height}' src='http://www.youtube.com/embed/#{video}' frameborder='0' allowfullscreen></iframe>".html_safe
70
70
  end
71
71
 
@@ -73,11 +73,21 @@ module HelperMethods
73
73
  link_to "www.youtube.com/watch?v=#{video}", "http://www.youtube.com/watch?v=#{video}", class: 'various fancybox-media'
74
74
  end
75
75
 
76
- def icon(icon, text="", direction="l")
76
+ def bootstrap_icon(icon, text="", direction="l")
77
77
  return "<i class='icon-#{icon}'></i> #{text}".html_safe if direction == 'l'
78
78
  return "#{text} <i class='icon-#{icon}'></i>".html_safe if direction == 'r'
79
79
  end
80
80
 
81
+ def bootstrap_label(text, name="")
82
+ name = "label-#{name}" unless name.nil?
83
+ return %(<span class="label #{name}">#{text}</span>).html_safe
84
+ end
85
+
86
+ def bootstrap_badge(text, name="")
87
+ name = "badge-#{name}" unless name.nil?
88
+ return %(<span class="badge #{name}">#{text}</span>).html_safe
89
+ end
90
+
81
91
  def active_link_to(*args, &block)
82
92
  if block_given?
83
93
  name = capture(&block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helper_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
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: 2013-06-10 00:00:00.000000000 Z
12
+ date: 2013-06-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A small collection of simple methods
15
15
  email: