i got some problem with a resourceless form inside activeadmin page:
ActiveAdmin.register_page 'TestDashboard' do
menu :label => 'TestDashboard'
content title: 'TestDashboard' do
columns do
column do
div do
semantic_form_for 'dashboard', :url => '#' do |f|
f.inputs :name => 'Configure', :class => 'inputs' do
f.input :target
f.input :name
end
end
end
end
end
end # content
end
only the last field (name) is shown. The resulting html is:
<form novalidate="novalidate" method="post" class="formtastic dashboard" action="#" accept-charset="UTF-8">
<div style="margin:0;padding:0;display:inline"><input type="hidden" value="✓" name="utf8">
<input type="hidden" value="3424234blabla" name="authenticity_token">
</div>
<fieldset class="inputs">
<legend>
<span>Configure</span>
</legend>
<ol>
<li id="dashboard_name_input" class="string input required stringish">
<label for="dashboard_name" class="label">Name<abbr title="required">*</abbr></label>
<input type="text" name="dashboard[name]" id="dashboard_name">
</li>
</ol>
</fieldset>
</form>
Thank you in advance.
You should put this in a partial:
In views/admin/testdashboard/_configure_form.html.erb
<%= semantic_form_for 'dashboard', :url => '#' do |f| %>
<%= f.inputs :name => 'Configure', :class => 'inputs' do %>
<%= f.input :target %>
<%= f.input :name %>
<% end %>
<% end %>
In your TestDashboard.rb
ActiveAdmin.register_page 'TestDashboard' do
menu :label => 'TestDashboard'
content title: 'TestDashboard' do
columns do
column do
render "configure_form"
end
end
end # content
end
And it should work nicely then :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With