⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 action_view_mods.rb

📁 用ruby on rails写的一个博客程序,还不错..ruby on rails的确是个好框架
💻 RB
字号:
begin  require 'rubygems'  require 'active_support'  require 'action_controller'  require 'action_view'  action_view_included = truerescue LoadError  action_view_included = falseendif action_view_included  class ActionView::Base    alias_method :old_concat, :concat unless instance_methods.include? "old_concat"    alias_method :old_form_tag, :form_tag unless instance_methods.include? "old_form_tag"  end    module Haml    module Helpers      # This module overrides various helpers in ActionView to make them      # work more effectively with Haml. It's not available unless ActionView      # is installed.      #      #--      # Methods in this module should be nodoc'd.      #++      module ActionViewMods        def self.included(othermod) # :nodoc:          othermod.class_eval do            action_view(true)            alias_method :capture_erb_with_buffer, :capture_haml_with_buffer          end        end                def concat(string, binding = nil) # :nodoc:          buffer.buffer.concat(string)        end                def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &proc) # :nodoc:          if block_given?            oldproc = proc             proc = bind_proc do |*args|              concat "\n"              tab_up              oldproc.call(*args)              tab_down            end          end          old_form_tag(url_for_options, options, *parameters_for_url, &proc)        end      end    end  endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -