<form novalidate="novalidate" class="formtastic first" action="/admin/blogs/2/posts/7/second" accept-charset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓">
<input type="hidden" name="authenticity_token" value=".........................">
<fieldset class="inputs">
<legend>
<span>Main</span>
</legend>
<ol>
<li class="string input required stringish" id="first_field1_input">
<label for="first_field1" class="label">Field1<abbr title="required">*</abbr></label>
<input id="first_field1" value="field1" disabled="disabled" type="text" name="first[field1]">
</li>
<li class="string input required stringish" id="first_field2_input">
<label for="first_field2" class="label">Field2<abbr title="required">*</abbr></label>
<input id="first_field2" value="field2" disabled="disabled" type="text" name="first[field2]">
</li>
<li class="string input required stringish" id="first_field3_input">
<label for="first_field3" class="label">Field3<abbr title="required">*</abbr></label>
<input id="first_field3" value="field3" disabled="disabled" type="text" name="first[field3]">
</li>
</ol>
</fieldset>
<fieldset class="actions">
<ol>
<li class="action input_action " id="first_submit_action"><input type="submit" name="commit" value="Submit First"></li>
<li class="cancel"><a href="/admin/blogs/2/posts">Отмена</a></li>
</ol>
</fieldset>
</form>
member_action :first, method: :get;
member_action :second, method: :post;
controller do
def first
end
def second
render json: params
end
end
method="post"
есть. active_admin_form_for :first, url: {action: :second}, method: 'post' do |f|
f.inputs 'Main' do
f.input :field1, input_html: {value: 'field1', disabled: true}, required: true
f.input :field2, input_html: {value: 'field2', disabled: true}, required: true
f.input :field3, input_html: {value: 'field3', disabled: true}, required: true
end
f.actions
end
permit_params do
allowed = [
:title,
:text
# ...
]
permitted = *allowed
permitted << :other if params[:action] == 'create' && current_user.is_admin?
permitted
end