This is the basic structure I use to create a mixin in Ruby:
# = Mixin Template # == Usage # ActionController::Base.send :include, MixinModuleName module MixinModuleName def self.included(recipient) recipient.extend(ClassMethods) recipient.class_eval do include InstanceMethods end end module InstanceMethods end module ClassMethods end end
Hey Ivan sorry for the out of topic question. I’m about to start a wordpress blog about ruby on rails and iPhone programming. What plugin are you using to render the code snippets on your wordpress blog? thanks!
Hi rafavega,
I’m just uploading the Ruby on Rails application that I use to create my snippets. It’s pretty simple to use.
For WordPress you’ll need “Custom CSS” premium feature and paste the coderay.css (from the app) to your WordPress CSS code.
Best,
Ivan
Unfortunately I have some problems with Github so I can upload on any of my newly created repos :( I let you know as soon I upload the code.
Thanks Ivan! Any chance you can email the code to me?
email[dot]rafa[a t]gmail[.]com
done!
Story added…
Your story was featured in MVCForge – News for MVC Web Developers! Here is the link to vote it up and promote it: http://mvcforge.com/ruby_on_rails/Ruby-Mixin-Template…