Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
made pages work again
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Oct 27, 2008
1 parent 1ff2713 commit b26f8da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions app/controllers/admin/pages_controller.rb
Expand Up @@ -51,7 +51,7 @@ def create
respond_to do |format|
format.html{
flash[:notice] = message
redirect_to admin_page_path(@page)
redirect_to edit_admin_page_path(@page)
}
format.js{
flash.now[:message] = message
Expand Down Expand Up @@ -118,10 +118,12 @@ def manage_tree

protected
def attach_page_plugins
@page.reload
params[:page_plugins].each do |page_plugin|
plug = @page.page_plugins.build(:module_type => page_plugin)
if params[:page_plugins]
@page.reload
params[:page_plugins].each do |page_plugin|
plug = @page.page_plugins.build(:module_type => page_plugin)
end
@page.save
end
@page.save
end
end
6 changes: 4 additions & 2 deletions app/views/admin/pages/new.html.erb
Expand Up @@ -3,8 +3,10 @@
<%= hidden_field 'page', 'parent_id' %>
<%= hidden_field 'page', 'page_order' %>
<%= render :partial => 'form' %>
<% params[:page_plugins].each do |page_plugin| -%>
<%= hidden_field_tag "page_plugins[]", page_plugin -%>
<% if params[:page_plugins] -%>
<% params[:page_plugins].each do |page_plugin| -%>
<%= hidden_field_tag "page_plugins[]", page_plugin -%>
<% end -%>
<% end -%>
<%= submit_tag 'Create', :class => 'submit' %>
<% end -%>

0 comments on commit b26f8da

Please sign in to comment.