Currying is the technique of transforming a function that takes multiple arguments (or a tuple of arguments) in such a way that it can be called as a chain of functions, each with a single argument .
Warning:
Blocked a frame with origin "http://localhost:3000" from accessing a frame with origin "http://127.0.0.1:3000". Protocols, domains, and ports must match.
Return:
Location {}
Since Rails 3, unconspicuous javascript(jquery-rails) instead of prototype.js to make
thing easily. It provide a sample way to handle ajax, confirm, etc…
Sometimes jquery-rails couldn’t fit for our situation.For example:
With added “confirm: ‘this is is a confirm’”, the button element
has the confirm function. But We could’t dynamically set the text whlie
the confirm appear.
In this case, We can add a monkey patch into jquery-rails to fit for our need.
First of all We look at the source of juqery-rails, figure out what make
this happened.
# In config/environments/production.rb or config/initializers/delayed_job.rb# Optional but recommended for less future surprises.# Fail at startup if method does not exist instead of later in a background job.[[ExceptionNotifier::Notifier,:background_exception_notification]].eachdo|object,method_name|raiseNoMethodError,"undefined method `#{method_name}' for #{object.inspect}"unlessobject.respond_to?(method_name,true)end# Chain delayed job's handle_failed_job method to do exception notificationDelayed::Worker.class_evaldo.defhandle_failed_job_with_notification(job,error)handle_failed_job_without_notification(job,error)# only actually send mail in productionifRails.env.production?# rescue if ExceptionNotifier fails for some reasonbeginExceptionNotifier::Notifier.background_exception_notification(error)rescueException=>eRails.logger.error"ExceptionNotifier failed: #{e.class.name}: #{e.message}"e.backtrace.eachdo|f|Rails.logger.error" #{f}"endRails.logger.flushendendend.alias_method_chain:handle_failed_job,:notification.end