context_help 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,15 +2,17 @@ module ActionView
2
2
  module Helpers
3
3
  module FormTagHelper
4
4
  def form_tag_with_context_help_form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block)
5
- help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => :form, :tag_options => options}}}, options)
5
+ help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => :form, :tag_options => options.dup}}}, options)
6
6
  ContextHelp::Base.help_for(help_options)
7
7
  form_tag_without_context_help_form_tag(url_for_options, options, *parameters_for_url, &block)
8
8
  end
9
9
  def label_tag_with_context_help_label_tag(name, text = nil, options = {})
10
- help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => :label, :tag_options => options}}}, options)
10
+ help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => :label, :tag_options => options.dup}}}, options)
11
11
  text ||= name.to_s.humanize
12
12
  text = text + ContextHelp::Base.help_for(help_options)
13
- label_tag_without_context_help_label_tag name, text, ContextHelp::Helpers.clean(options)
13
+
14
+ options.delete('context_help')
15
+ label_tag_without_context_help_label_tag name, text, options
14
16
  end
15
17
 
16
18
  alias_method_chain :form_tag, :context_help_form_tag
@@ -12,8 +12,10 @@ module ContextHelp
12
12
  end
13
13
  def input(method, options = {})
14
14
  options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:model => model_name.to_sym, :attribute=> method.to_sym}}}, options || {})
15
- #options[:label_html] ||= {}
16
- #options[:label_html][:context_help] = options[:context_help]
15
+ options[:label_html] ||= {}
16
+ options[:label_html][:context_help] = options[:context_help].dup
17
+ options[:input_html] ||= {}
18
+ options[:input_html][:context_help] = options[:context_help].dup
17
19
  super method, options
18
20
  end
19
21
  def radio_input(method, options)
@@ -2,12 +2,12 @@ module ActionView
2
2
  module Helpers
3
3
  module TagHelper
4
4
  def tag_with_context_help_tag(name, options = {}, open = false, escape = true)
5
- help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => name.to_sym, :tag_options => options}}}, options)
5
+ help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => name.to_sym, :tag_options => options.dup}}}, options)
6
6
  help = ContextHelp::Base.help_for(help_options)
7
7
  tag_without_context_help_tag(name, ContextHelp::Helpers.clean(options), open, escape) + help
8
8
  end
9
9
  def content_tag_with_context_help_content_tag(name, content_or_options_with_block = nil, options = {}, escape = true, &block)
10
- help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => name.to_sym, :tag_options => options}}}, options)
10
+ help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => name.to_sym, :tag_options => options.dup}}}, options)
11
11
  help = ContextHelp::Base.help_for(help_options)
12
12
  content_tag_without_context_help_content_tag(name, content_or_options_with_block, ContextHelp::Helpers.clean(options), escape, &block) + help
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module ContextHelp
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: context_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
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: 2011-09-23 00:00:00.000000000 -03:00
12
+ date: 2011-09-26 00:00:00.000000000 -03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: ContextHelp is a gem that allows you to show inline or aside help about