Module: ModMonkey::MonkeyController
- Defined in:
- lib/modmonkey_client/mod_monkey.rb
Instance Method Summary collapse
- #flag ⇒ Object
-
#mm_update ⇒ Object
this method is called before any update actions in your controllers.
Instance Method Details
#flag ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/modmonkey_client/mod_monkey.rb', line 68 def flag klass = self.controller_name.singularize.camelize.constantize @obj = klass.find(params[:id]) # we might want to pass in some more args @obj.flag(params[:flag]) redirect_to :back end |
#mm_update ⇒ Object
this method is called before any update actions in your controllers
77 78 79 80 81 82 83 84 |
# File 'lib/modmonkey_client/mod_monkey.rb', line 77 def mm_update if params[:mod_monkey_item] klass = self.controller_name.singularize.camelize.constantize @obj = klass.find_by_mm_id_and_mm_key(params[:mod_monkey_item][:id], params[:mod_monkey_item][:item_key]) @obj.apply_mod_monkey_params( params[:mod_monkey_item] ) render :xml => @obj.to_xml and return false end end |