diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 93c82b2..2b7fcd3 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -30,10 +30,14 @@ class ApplicationController < ActionController::Base before_filter :load_profile_from_params def load_profile_from_params if params[:profile] - @profile = Profile.find_by_identifier(params[:profile]) + @profile ||= Profile.find_by_identifier(params[:profile]) end end + def profile + @profile + end + def self.acts_as_virtual_community_admin_controller before_filter :load_admin_controller end diff --git a/app/controllers/profile_editor_controller.rb b/app/controllers/profile_editor_controller.rb index 3c4bfce..729a312 100644 --- a/app/controllers/profile_editor_controller.rb +++ b/app/controllers/profile_editor_controller.rb @@ -4,8 +4,11 @@ class ProfileEditorController < ApplicationController # edits the profile info (posts back) def edit if request.post? + profile.info.update_attributes(params[:info]) + redirect_to :action => 'index' else - render :action => profile.info.class.tableize + @info = profile.info + render :action => @info.class.name.underscore end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6dd96c2..6c21404 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -158,4 +158,12 @@ module ApplicationHelper @profile || raise("There is no current profile") end + # displays an + # + # Current implementation generates a