From 72762e81c5f45bf7e941858575401e74014b93a5 Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Tue, 24 Jul 2007 14:05:40 +0000 Subject: [PATCH] ActionItem0: refactoring block plugins --- app/controllers/application.rb | 5 ++++- app/controllers/edit_template_controller.rb | 6 +++++- app/models/profile.rb | 3 ++- app/views/home/index.rhtml | 6 ++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 408e309..a44589b 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -9,7 +9,10 @@ class ApplicationController < ActionController::Base before_filter :detect_stuff_by_domain attr_reader :virtual_community - uses_manage_template :edit => false + uses_flexible_template + + def flexible_template_owner + end before_filter :load_template # Load the template belongs to a Profile and set it at @chosen_template variable. diff --git a/app/controllers/edit_template_controller.rb b/app/controllers/edit_template_controller.rb index e6381a7..eda1ba0 100644 --- a/app/controllers/edit_template_controller.rb +++ b/app/controllers/edit_template_controller.rb @@ -1,5 +1,9 @@ class EditTemplateController < ApplicationController - uses_manage_template :edit => true + uses_flexible_template :edit => true + + def flexible_template_owner + Profile.find(1) + end end diff --git a/app/models/profile.rb b/app/models/profile.rb index fac0e08..91b7e94 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -3,6 +3,8 @@ # which by default is the one returned by VirtualCommunity:default. class Profile < ActiveRecord::Base + act_as_flexible_template + # Valid identifiers must match this format. IDENTIFIER_FORMAT = /^[a-z][a-z0-9_]+[a-z0-9]$/ @@ -16,7 +18,6 @@ class Profile < ActiveRecord::Base ] has_many :domains, :as => :owner - has_many :boxes, :as => :owner belongs_to :virtual_community belongs_to :user diff --git a/app/views/home/index.rhtml b/app/views/home/index.rhtml index 8cdb490..f8421ee 100644 --- a/app/views/home/index.rhtml +++ b/app/views/home/index.rhtml @@ -1,2 +1,8 @@ <%= flash[:notice] %> Start page of Virtual Community <%= @virtual_community.name %> + +Teste: +<%= @bla %> +<%= @bli.inspect %> +caralho + -- libgit2 0.21.2