How to insert hint information right after the input box?

710 views Asked by At

Not really an issue but some question that I need

Is it possible to attached html values right after the input box? Something like a small text info below the input box

I have did something similar but its not pretty.

f.inputs "Blog" do
  f.input :view_counts, :input_html => { :readonly => true }
  f.input :slug
  li raw("<label class='label'>&nbsp;</label><span class='text-info'>Your Slug will be automatically based on your title or you can choose to enter your own slug title</span>")
  f.input :title
  f.input :content, :as => :ckeditor
  f.input :is_active
  f.input :admin_user_id, as: :hidden, :input_html => { :value => current_admin_user.id }
end

The code is between :slug and :title. You will catch a draft of what I am trying to do. Thanks

2

There are 2 answers

0
Cedric Loy On BEST ANSWER

Thanks for the help, I found the way to do it.

f.input :slug, hint:"love u"

This will add a small cursive text just below the input box.

0
Rifatul Islam Chayon On

you can add a label like:

<label for="slug" class="hint">Your Slug will be automatically based on your title or you can choose to enter your own slug title</label>

Then add css styling something like:

.hint {
    font-weight: normal;
    color: #777;
    font-size: .85em;
}