ruby on rails - active_admin and has_one association -


i have 2 models following associations:

class panel < activerecord::base   belongs_to :survey end   class survey < activerecord::base   has_one :panel end 

and i'm using active_admin manage surveys:

activeadmin.register survey   config.per_page = 20    actions :index, :edit, :update    index     column 'survey id' |s|       s.id     actions defaults: true   end    form |f|     inputs       input :id, input_html: { disabled: true }     end     f.actions   end end 

and want add field form have possibility change survey panel. read through documentation of active_admin didn't find similar case... possible activeadmin?

you can create forms nested models using has_many method, if model uses has_one

https://github.com/activeadmin/activeadmin/blob/9c46b14ea0d9b3aaaa3d7520555c9959d06ce7f3/docs/5-forms.md#nested-resources


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -