Skip to content

Commit

Permalink
Basic controller to handle page updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
peakpg committed Mar 19, 2013
1 parent ddf31b4 commit 13a55c0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/controllers/cms/page_components_controller.rb
@@ -0,0 +1,8 @@
module Cms
class PageComponentsController < Cms::ApplicationController

def update
render text: "Hello"
end
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/cms/page_editor.html.erb
Expand Up @@ -24,7 +24,7 @@
<%= render 'layouts/cms/thin_toolbar' %>
<script type="text/javascript">
// Set to the url that you want to save any given page to, leave null for default handling.
var saveUrl = null;
var saveUrl = '<%= cms.page_component_path(current_page) %>';

// Instantiate the PageEditor
new Mercury.PageEditor(saveUrl, {
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -14,6 +14,7 @@
match '/toolbar', :to=>"toolbar#index", :as=>'toolbar'
match '/content_types', :to=>"content_types#index", :as=>'content_types'

resources :page_components
resources :connectors do
member do
put :move_up
Expand Down
8 changes: 6 additions & 2 deletions script/rails
Expand Up @@ -10,8 +10,12 @@ load File.expand_path('../../test/dummy/script/rails', __FILE__)
# - rails destroy
# I kept the above (for now anyway) so I can get access to rails server, though I will need to test that it works for other commands too.

# Bugs: Adding the following would:
# 1. Enable generators to work correctly (right now they put code into test/dummy)
# 2. Prevent loading, since engine requires other files directly.

#ENGINE_ROOT = File.expand_path('../..', __FILE__)
#ENGINE_PATH = File.expand_path('../../lib/browsercms/engine', __FILE__)
#
#ENGINE_PATH = File.expand_path('../../lib/cms/engine', __FILE__)
##
#require 'rails/all'
#require 'rails/engine/commands'

0 comments on commit 13a55c0

Please sign in to comment.