Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::PrototypeHelper, ActionView::Helpers::ScriptaculousHelper, ActionView::Helpers::TagHelper, ApplicationHelper, Localization, UserSystem
Defined in:
app/controllers/application.rb

Constant Summary

Constants included from Localization

Localization::LOCALIZED_STRINGS

Class Method Summary collapse

Methods included from ApplicationHelper

#back_or_link_to, #h, #image_button_to, #image_detour_to, #image_link_to, #t, #with_detour

Methods included from Localization

#l, load_localized_strings, #valid_language?

Class Method Details

.in_place_edit_for(object, attribute, options = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'app/controllers/application.rb', line 19

def self.in_place_edit_for(object, attribute, options = {})
  define_method("set_#{object}_#{attribute}") do
    @item = object.to_s.camelize.constantize.find(params[:id])
    @item.update_attribute(attribute, params[:value])
    render :text => @item.send(attribute).to_s
  end
end