Experience of metaprogramming Rails plugin

2011-04-21  来源:本站原创  分类:Ruby  人气:87 

Compared with Java, JAVA in the use of AOP in Ruby this aristocratic very ordinary people.

Iteye interview, third, and the subject asked to write a Rails plug-ins. Write plug-ins in the learning process, I deeply appreciate the great dynamic language.
Learn Ruby on Rails recommend friends to write a simple plug-in, write it makes you learn a lot of Ruby syntax is the basis of things.
Are:

  1. Understand the scope of self Key words meaning in different
  2. require statement
  3. Familiar with the module, learned some of that comes with ruby ​​callback methods, such as the included module
  4. Send include extend methods to understand the meaning
  5. Learn eval class_eval instance_eval alias_method these commonly used methods of meta-programming
  6. Learn some common methods like Method

I do not write specific information, and online there are many, can take the time to find go ...

相关文章
  • Experience of metaprogramming Rails plugin 2011-04-21

    Compared with Java, JAVA in the use of AOP in Ruby this aristocratic very ordinary people. Iteye interview, third, and the subject asked to write a Rails plug-ins. Write plug-ins in the learning process, I deeply appreciate the great dynamic language

  • ruby, ruby gems, gemsonrails, rails plugin the relationship between 2009-03-14

    * ruby reference between all the source code are invoked, in order to standardize the management of libraries, gems emerged. gems are ruby source code management tool, code in accordance with a certain directory structure was organized into a lib. Fo

  • Rails plugin for pretty flash messages 2009-05-28

    Rails plugin for pretty flash messages http://rpheath.com/posts/379-rails-plugin-for-pretty-flash-messages Displaying flash messages is, for the most part, pretty consistent across all of my applications. I usually make use of three: notice, warning,

  • FCKEditor in Rails to use Easy FCKEditor Rails plugin 2010-07-01

    Easy FCKEditor Rails plugin ======= Gastón Ramos ramos.gaston [at] gmail [dot] com http://gastonramos.wordpress.com/ Easy FCKEditor is a Rails Plugin thats generate a WYSIWYG text editor helper. This version is a fork of Scott Rutherford [great plugi

  • How to write a Rails Plugin (for controllers) 2009-07-22

    Original: http://ariejan.net/2007/07/06/how-to-write-a-rails-plugin-for-controllers/ A few days ago I released my first Rails plug-ins: Acts As Exportable . Although very easy to write a plug-in, you've got to know some of it up and running skills. T

  • Active Scaffold Note - Rails Plugin 2010-07-23

    1. Install ./script/plugin install git://github.com/activescaffold/active_scaffold.git -r rails-2.3 Rails 2.3.x needs the plugin render_component for nested scaffolds ./script/plugin install git://github.com/ewildgoose/render_component.git -r rails-2

  • Rails plugin to use video to Amazon S3 Paperclip services 2010-08-30

    Amazon's S3 cloud service and EC2 in the more commonly used here is to introduce a plug-and S3 upload for use with an example. Create model #video.rb class Video < ActiveRecord::Base # Paperclip # http://www.thoughtbot.com/projects/paperclip has_atta

  • rails plugin Negative Captcha Code Generation Profile 2010-08-18

    Install plug-ins: script/plugin install http://code.subwindow.com/negative_captcha git submodule add git://github.com/subwindow/negative-captcha.git vendor/plugins/negative_captcha controller callback before_filter :setup_negative_captcha, :only => [

  • About rails plugin acts_as_inviteable invite mechanism 2010-08-19

    Here is a demo invitation Installation can follow the plug-in installed script/plugin install git://github.com/vigetlabs/acts_as_inviteable.git Generates the corresponding code script/generate invitations_for User Will actually be generated: map.reso

  • hpricot: rails plugin Analytical html 2009-10-14

    pricot is fast and easy-to-use Ruby HTML parser, the source of JQuery. It is characterized by 1. Fast, because the core 2 with C rewritten. Easy to use interface, you can use CSS selectors, element IDs, tag types, etc.. Other features can resolve XML

  • rails plugin - auto_migrations 2010-03-02

    Generally, we change the table structure, the data is automatically cleared, very troublesome. auto_migrations for us to solve this problem, add or delete table fields just use rake db: schema: load

  • Rails plugin Markdown 2010-07-28

    1. RDiscount http://github.com/rtomayko/rdiscount > sudo gem install rdiscount Usage RDiscount implements the basic protocol popularized by RedCloth and adopted by BlueCloth: require 'rdiscount' markdown = RDiscount.new("Hello World!") puts m

  • rails plugin pagination will_paginate ajax implementation 2010-12-09

    class AjaxLinkRenderer < WillPaginate::LinkRenderer def page_link_or_span(page, span_class = 'current', text = nil) text ||= page.to_s classnames = Array[*span_class] if page and page != current_page if @options[:update] @template.link_to_remote text

  • rails export excel using the standard plug-in spreadsheet 2009-05-17

    This article is the introduction of basic knowledge of spreadsheet, the plug-ins can read and generate excel file If you want to see more complex examples, click here If you want to see more simple examples of analytic excel document, click here If y

  • Rails localization plugin to achieve multi-language support 2010-02-18

    <br /> localization plug introduced in Rails 2.2 version before, Rails applications that are used to achieve localization plug the localization of applications to support multiple languages. localization somewhat similar to the gettext, using a very

  • Upgrading from Rails 2.3.5 to Rails 3.0 beta 2010-03-27

    Because there is a new project intended to use Rails 3.0 beta, we first try to upgrade from Rails 2.3.5 to Rails 3.0 beta. Please refer to the official Release note http://guides.rails.info/3_0_release_notes.html JavaEye also has an article on the ht

  • <Switch> Advanced Learning Ruby on Rails 2010-06-07

    Original Address -> http://blog.xdite.net/?p=1227 From Blog.XDite.net of: xdite On a reference to a number of entry will be the basis for training. And now to continue to write the Advanced chapter. Divided into two directions: arbitrary integration

  • PHPRPC for rails 2009-03-23

    I want to use rails agile development, PHPRPC wanted to use the cross-language, cross-platform, cross-environment characteristics. Now that andot have achieved PHPRPC for ruby, why then did I not PHPRPC for rails? Future is bright, the process is dif

  • Rails week 1 (1): Restful Authentication 2009-05-06

    What is Restful Authenticaiton: Restful Authentication is a Rails plug-in authentication system, which you generate a REST-style authentication template. Specific concepts and to generate operating See: Rails-style book of 67: restful_authentication

  • Export excel form rails 2009-05-17

    Official Nets spreadsheet Local gem download Local plugin download About, excel treatment of ruby, If you want to see more complex examples, click here If you want to see more simple examples of analytic excel document, click here If, under the windo