Skip to content

Commit

Permalink
hack fix for bug 477
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlarsen committed Aug 18, 2009
1 parent 59a3e7a commit 2b616a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hobo/dryml_generators/rapid/pages.dryml.erb
Expand Up @@ -55,7 +55,7 @@ new_form = !new_link && linkable?(model, :create, :method => :post)
<% if new_form -%>
<div param="new-form">
<h3 param="new-form-heading">New <%= model_name :title %></h3>
<form with="&new_for_current_user <%= model %>" param/>
<form with="&@invalid_record || new_for_current_user(<%= model %>)" param/>
</div>

<% end -%>
Expand Down
12 changes: 11 additions & 1 deletion hobo/lib/hobo/model_controller.rb
Expand Up @@ -355,9 +355,19 @@ def valid?; this.errors.empty?; end

def re_render_form(default_action=nil)
if params[:page_path]
@invalid_record = this
controller, view = Controller.controller_and_view_for(params[:page_path])
view = default_action if view == Dryml::EMPTY_PAGE
render :template => "#{controller}/#{view}"

# Hack fix for Bug 477. See also bug 489.
if view=="index"
require 'ruby-debug' ; debugger
params['action'] = 'index'
self.action_name = 'index'
index
else
render :template => "#{controller}/#{view}"
end
else
render :action => default_action
end
Expand Down

0 comments on commit 2b616a6

Please sign in to comment.