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
Post a Comment