I want to stop people adding or editing Page Layout from inside a sub form. Basically I want to turn off the buttons in the below screenshot:

Am I able to do this, or do I have to turn off adding and editing on the entire Page Layout model globally?
I want to stop people adding or editing Page Layout from inside a sub form. Basically I want to turn off the buttons in the below screenshot:

Am I able to do this, or do I have to turn off adding and editing on the entire Page Layout model globally?
Probably a bit late but you can use inline_add and inline_edit.
Example:
field :profile do
inline_add false
inline_edit false
end
Maybe not the cleanest solution... anyway here's what i did. Created an alternative partial copying the original one and stripping off the links related to "add new" and "edit". Then I configured the field like this.
field :operator_user do
partial "form_filtering_select_no-relations"
def selected_id
@bindings[:object]['operator_user_id']
end
end
The partial expects a method called "selected_id" to be there and return the id used to build the relation.
Supposing you are talking about authorizing a specific type of user to "see" the buttons you can go with the cancan gem.