Method: AdminAssistant::VirtualColumn::FormView#default_html
- Defined in:
- lib/admin_assistant/virtual_column.rb
#default_html(form) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/admin_assistant/virtual_column.rb', line 47 def default_html(form) object = form.object input_name = "#{@column.model_class.name.underscore}[#{name}]" input = @input || :text_field html = if input == :check_box (input_name, value(object)) else @action_view.send("#{input}_tag", input_name, string(object)) end if has_matching_errors?(object) html = "<div class=\"field_with_errors\">#{html}</div>" end html end |