Hi,
I am not sure what you are trying to do and where you call your method, but
it may be a strong parameter issue. We create host(group) by passing it
parameters and calling 'save' on it [1].
Notice the 'hostgroup_params' method. It comes from a concern [2] that
takes care of whitelisting the params that we want to update. So if you add
new fields, you need to make sure they do not get filtered out.

Hope this helps,
Ondrej Prazak

[1]
https://github.com/theforeman/foreman/blob/develop/app/controllers/hostgroups_controller.rb#L42-L43
[2]
https://github.com/theforeman/foreman/blob/develop/app/controllers/concerns/foreman/controller/parameters/hostgroup.rb

On Tue, Aug 1, 2017 at 10:06 AM, Fairouz el ouazi <elouazifair...@gmail.com>
wrote:

> Hi everyone !!
>
>  My questions will sound a  bit stupide but i don't know how to call the
> method create Host or hostgroup with new fields from my new plugin  ? all i
> know is with name and when i add fields value like operating_system id it
> doesn't' appears on  foreman UI ?
>
> Thanks in advance for you help
>
> --
> You received this message because you are subscribed to the Google Groups
> "foreman-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to