Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Can't use FormBuilder.default_hint_class? #130

Open
bunnymatic opened this issue Jul 20, 2015 · 1 comment
Open

Can't use FormBuilder.default_hint_class? #130

bunnymatic opened this issue Jul 20, 2015 · 1 comment

Comments

@bunnymatic
Copy link

In our app we're putting in a ckeditor row like so (in slim templates):

= f.input :description, as: :ckeditor, hint: 'For best results...', input_html: { ckeditor: { toolbar: 'mini' } }

This fails when the CkEditorInput (a formtastic input from the ckeditor gem) calls for a hint:

def hint_html
  if hint?
    template.content_tag(
      :p, 
      Formtastic::Util.html_safe(hint_text), 
      class => builder.default_hint_class
    )
  end
end

After further digging, it seems that FormtasticBootstrap::FormBuilder raises (https://github.com/mjbellantoni/formtastic-bootstrap/blob/master/lib/formtastic-bootstrap/form_builder.rb#L22) ...

def self.default_hint_class
  # self.default_inline_hint_class
  raise
end

Is there a good reason for this raise? I got around the issue by monkey patching that method. But I'd rather not have to do that.

Also, seemingly strangely we have this line in the same form:

= f.input :price, as: :string, hint: 'in dollars without the $ sign.'

and it works just fine.

Thanks for any info.

Relevant Gems:

  • formtastic (3.1.3)
  • formtastic-bootstrap (3.1.0)
  • ckeditor (4.1.2)
@bunnymatic bunnymatic changed the title Can't use default_inline_hint? Can't use FormBuilder.default_hint_class? Jul 20, 2015
@mjbellantoni
Copy link
Owner

I'm afraid if there's a good reason for this, I do not remember what it is. It's most likely an oversight. Can you submit a patch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants