forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Form Partial Tricks
Daxter edited this page May 23, 2012
·
7 revisions
In order to have Active Admin-style submit & cancel buttons, a hacky approach is unfortunately necessary because the usual f.actions
is a special function defined in Active Admin, and is not accessible from your partial.
However there is hope! If you want to have a consistent look on your forms, you can easily trick the browser into using Active Admin's styling rules:
<%= a.actions do %>
<%= a.action :submit %>
<li class="cancel"><%= link_to "Cancel", post %></li>
<% end %>
Note - you can change the 'cancel' link to go anywhere you want. In the above, it redirects to the Post index page. Be sure to change post
to the name of your model!