0

I have a tooltip that use this html attribute "original-title".

I have tryed this:

content_tag(:span, '', :class => options[:pinfo_class], :original-title => options[:pinfo])

But it gives a error in view.

Then I have used this which works, but not with the tooltip.

content_tag(:span, '', :class => options[:pinfo_class], :original_title => options[:pinfo])

How do I force rails to use the :original-title ?

1 Answer 1

5

You can use a string as a hash key, like 'original-title' => options[:pinfo]. Should work.

Also, most strings can be converted to symbols via 'some-string'.to_sym method, or even defined as :'some-string'.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.