%= form_for @dashboard, url: (@dashboard.persisted? ? dashboard_path(@dashboard, variable_params) : dashboards_path(variable_params)), html: {id: "app", class: "small-form"} do |f| %> <% if @dashboard.errors.any? %>
<% if @dashboard.persisted? %> <%= link_to "Delete", dashboard_path(@dashboard), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger"%> <% end %> <%= f.submit "Save", class: "btn btn-success" %> <%= link_to "Back", :back, class: "btn btn-link" %>
<% end %>