Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for admin forms for models w modules

  • Loading branch information...
commit 947b45113acc5fa417759e4bbb316a9712a8242d 1 parent db97375
@geraldb geraldb authored
View
2  app/views/admin/pools/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for [:admin, @pool] do |f| %>
+<%= form_for( @pool, :as => :pool, :url => @pool.new_record? ? admin_pools_path() : admin_pool_path(@pool) ) do |f| %>
<% if @pool.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@pool.errors.count, "error") %> prohibited this pool from being saved:</h2>
View
5 app/views/admin/users/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for(@user) do |f| %>
+<%= form_for(@user, :as => :user, :url => @user.new_record? ? users_path() : user_path(@user) ) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
@@ -10,8 +10,7 @@
</ul>
</div>
<% end %>
-
-
+
<table>
<tr>
<td><%= f.label :name, 'Name:' %></td>
View
2  app/views/setup/bonus_rounds/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for(@round, :url => setup_bonus_rounds_path()) do |f| %>
+<%= form_for(@round, :as => :round, :url => @round.new_record? ? setup_bonus_rounds_path() : setup_bonus_round_path(@round) ) do |f| %>
<% if @round.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@round.errors.count, "error") %> prohibited this round from being saved:</h2>
Please sign in to comment.
Something went wrong with that request. Please try again.