Commit 6f63b94b06ed35c3abcaa5119d10e62acefb46ea
1 parent
790e2816
Exists in
master
and in
28 other branches
ActionItem19: fixing routing bugs for design plugin
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@830 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
9 additions
and
5 deletions
Show diff stats
app/controllers/profile_admin/profile_editor_controller.rb
db/migrate/001_add_design_support.rb
1 | 1 | class AddDesignSupport < ActiveRecord::Migration |
2 | 2 | def self.up |
3 | - | |
4 | 3 | create_table :design_boxes do |t| |
5 | 4 | t.column :name, :string |
6 | 5 | t.column :title, :string |
... | ... | @@ -10,12 +9,11 @@ class AddDesignSupport < ActiveRecord::Migration |
10 | 9 | end |
11 | 10 | |
12 | 11 | create_table :design_blocks do |t| |
13 | - t.column :name, :string | |
14 | 12 | t.column :title, :string |
15 | 13 | t.column :box_id, :integer |
16 | 14 | t.column :position, :integer |
17 | 15 | t.column :type, :string |
18 | - t.column :helper, :string | |
16 | + t.column :settings, :text | |
19 | 17 | end |
20 | 18 | |
21 | 19 | end | ... | ... |
lib/noosfero.rb
... | ... | @@ -4,7 +4,13 @@ module Noosfero |
4 | 4 | SVN_ROOT = 'https://svn.colivre.coop.br/svn/noosfero' |
5 | 5 | |
6 | 6 | def self.controllers_in_directory(dir) |
7 | - Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')).map do |item| | |
7 | + app_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')) | |
8 | + | |
9 | + # FIXME we can remove this line here if the controllers needed by application are not loaded | |
10 | + # directly | |
11 | + design_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'design_blocks', '*', 'controllers', '*_controller.rb')) | |
12 | + | |
13 | + (app_controller_path + design_controller_path).map do |item| | |
8 | 14 | item.gsub(/^.*\/([^\/]+)_controller.rb$/, '\1') |
9 | 15 | end |
10 | 16 | end | ... | ... |