context_help 0.0.5 → 0.0.6

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.
@@ -214,7 +214,6 @@ module ContextHelp
214
214
 
215
215
  plugin_prefixes.each do |prefix|
216
216
  begin
217
- Rails.logger.info "CHH: " + prefix + path
218
217
  item = I18n.translate prefix + path, :raise => true
219
218
  if item.start_with?('t.')
220
219
  item = I18n.t item[2, item.length]
@@ -244,7 +243,7 @@ module ContextHelp
244
243
  end
245
244
  return base
246
245
  else
247
- return base || added
246
+ return added || base
248
247
  end
249
248
  end
250
249
  def self.clean(options)
@@ -3,19 +3,25 @@ module ContextHelp
3
3
  def inputs(*args, &block)
4
4
  title = field_set_title_from_args(*args)
5
5
  html_options = args.extract_options!
6
+
6
7
  help_options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:tag => 'fieldset', :tag_options => html_options}}}, html_options)
7
8
  help_options[:context_help][:title] = title if help_options[:context_help][:path][:tag]
9
+
8
10
  help = ContextHelp::Base.help_for(help_options)
9
11
  super *(args<<help_options), &block
10
12
  end
11
13
  def input(method, options = {})
12
14
  options = ContextHelp::Helpers.merge_options({:context_help => {:path => {:model => model_name.to_sym, :attribute=> method.to_sym}}}, options || {})
13
- super
15
+ options[:input_html] ||= {}
16
+ options[:input_html][:context_help] = options[:context_help]
17
+ options[:label_html] ||= {}
18
+ options[:label_html][:context_help] = options[:context_help]
19
+ super method, options
14
20
  end
15
21
  def radio_input(method, options)
16
22
  options[:label] = localized_string(method, options[:label], :label) || humanized_attribute_name(method)
17
23
  ContextHelp::Base.help_for(options)
18
- super
24
+ super method, options
19
25
  end
20
26
  def legend_tag(method, options = {})
21
27
  if options[:label] == false
@@ -1,3 +1,3 @@
1
1
  module ContextHelp
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
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.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: