Module: ModMonkey::MerbMonkeyProfileController

Defined in:
lib/modmonkey_client/mod_monkey.rb

Overview

MERB STUFF

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



91
92
93
# File 'lib/modmonkey_client/mod_monkey.rb', line 91

def self.included(base)
  base.show_action(:mm_profile_update)
end

Instance Method Details

#mm_profile_updateObject

this method is called before any update actions in your controllers



96
97
98
99
100
101
102
103
# File 'lib/modmonkey_client/mod_monkey.rb', line 96

def mm_profile_update
  if params[:mod_monkey_profile]
    klass = self.controller_name.singularize.camelize.constantize
    @obj = klass.find(params[:id])
    @obj.apply_mod_monkey_params(params[:mod_monkey_profile])
    render @obj.to_xml and throw :halt
  end
end