I’m trying to add tooltips to read-only inputs that might not always be wide enough to show the full content. The tooltips will be used to show the full content when the user hovers over the input.
The problem is that I cannot seem to access the resource attributes in the form builder paramaters section. I’m trying to make the value of the input the title. See the following code:
= f.fields_for :invoice_items, @invoice.invoice_items do |item|
%tr
%td
= item.text_field :code, :title => item.name, :rel=>'tooltip', :class => 'uneditable-input span1', :readonly=>'true
Raises:
undefined method `name' for #<ActionView::Helpers::FormBuilder:0x007fea1e86f8e8>
Now with that we can see that item isn’t actually the resource, but the form builder class. How can I access the original resource from here?
I think this will do what you want:
You might need to take out the second parameter, the