Permalink
Browse files

fix for admin forms for models w modules

  • Loading branch information...
1 parent db97375 commit 947b45113acc5fa417759e4bbb316a9712a8242d @geraldb geraldb committed Dec 11, 2012
@@ -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>
@@ -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>
@@ -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>

0 comments on commit 947b451

Please sign in to comment.