lib/padrino-responders/default.rb
##
# In this response we can decide where system will redirect us after successfully
# executed action. Redirections are allowed only for html requests. If 
# location is not specified then by default for html and js we will see 
# template, for other formats serialised object. System also will show flash
# message about destroyed object.  
#
In this response we can decide where system will redirect us after successfully
executed action. Redirections are allowed only for html requests. If
location is not specified then by default for html and js we will see
template, for other formats serialised object. System also will show flash
message about destroyed object.
In this response we can decide where system will redirect us after successfully executed action . Redirections are allowed only for html requests . If location is not specified then by default for html and js we will see template for other formats serialised object . System also will show flash message about destroyed object .
def default_response_for_destroy(object, location=nil)
          object_notice      = "responder.messages.#{controller_name}.destroy"
          alternative_notice = "responder.messages.default.destroy"
          if content_type == :html && location
            notify(:notice, t(object_notice, 
              :model   => human_model_name(object),
              :default => t(alternative_notice, human_model_name(object))
              ))
            redirect location
          else
            if [:html, :js].include?(content_type)
              render "#{controller_name}/destroy"
            else
              render content_type, object, :location => location
            end
          end
        end
def default_response_for_destroy ( object , location = nil ) object_notice = "responder.messages.#{controller_name}.destroy" alternative_notice = "responder.messages.default.destroy" if content_type == :html && location notify ( :notice , t ( object_notice , :model => human_model_name ( object ) , :default => t ( alternative_notice , human_model_name ( object ) ) ) ) redirect location else if [ :html , :js ] . include? ( content_type ) render "#{controller_name}/destroy" else render content_type , object , :location => location end end end
In this response we can decide where system will redirect us after successfully
executed action.
In this response we can decide where system will redirect us after successfully executed action .
object
<not_specific>
location
<not_specific>