ruby on rails - How would I add a fieldset to a resource in ActiveAdmin that does not correspond to a column? -


i able add field registered model in activeadmin not correspond column on model's table.

the model's table looks this: | id | remote_id | created_at | updated_at |

and code follows:

form |form_obj|   form_obj.inputs     form_obj.input :term, :required => true   end   form_obj.buttons end 

this issue have 'term' attribute not exist on model's table. instead set on remote database accessed using remote_id.

you can create virtual attribute in model belongs form:

def term= (attributes)   #this evaluated when save form end  def term   # return of method default value of field end 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -