Tag Archives: plugins

Hacking Rails Plugins

Using the Acts as Taggable On plugin to add categories to a model class, I wanted to override the to_param method and place the name attribute in the url. The plugin, installed as a gem, source shouldn’t need to be hacked in order to accomplish this. The solution is to add a plugin into the [...]
Posted in Programming | Also tagged , , , | Leave a comment

Rails Plugin Acts as Taggable on Steriods

You can download it here http://github.com/suitmymind/acts-as-taggable-on-steroids as well as read usage info (which is for the most part reprinted here). ./script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids ./script/generate acts_as_taggable_migration rake db:migrate Then in your model class Post < ActiveRecord::Base acts_as_taggable end And usage is as follows p = Post.find(:first) p.tag_list # [] p.tag_list = "Funny, Silly" p.save p.tag_list # ["Funny", "Silly"] p.tag_list.add("Great", "Awful") p.tag_list.remove("Funny") #to find... Post.find_tagged_with('Funny, Silly') Post.find_tagged_with('Funny, Silly', [...]
Posted in Ruby on Rails | Also tagged , , , | Leave a comment

TinyMCE Rich Text Editor: HELLO EDITOR Plugin Tutorial and Example

I wanted to create a button for the TinyMCE Rich Text Editor for Wordpress. It was tough to find good docs on the subject. There are a couple of useful posts out there but in general I found them lacking. http://codex.wordpress.org/TinyMCE_Custom_Buttons#Creating_an_MCE_Editor_Plugin The above resource has a good section on the PHP code needed to write your own [...]
Posted in Wordpress | Also tagged , , , , | Leave a comment

Rails Paperclip Plugin Options for Attaching Files

I usually change some of the default settings when I use the Paperclip plugin. For most of my projects I don’t like having separate directories for each image that is uploaded. I prefer, in this instance, to put avatars of different sizes together under one directory and differentiated based on the style size of the [...]
Posted in Ruby on Rails | Also tagged , , , | Leave a comment

Build Your Own Calendar in Rails without any Plugins in less than 10 lines of Ruby Code

There are a number of terrific calendar plugins for Rails. But it’s almost as easy, if not easier, to implement your own calendar. The steps are pretty simple. First get the @beginning_of_month and @end_of_month and iterate over the days in between. In the loop we check if the day matches the @beginning_of_month and if it does [...]
Posted in Ruby on Rails | Also tagged , , | Leave a comment

Acts_as_versioned Rails Plugin

Versioning models with the acts_as_versioned plugin cd rails/app ./script/plugin install git://github.com/technoweenie/acts_as_versioned.git ./script/generate model post title:string body:text In your model class Post < ActiveRecord::Base acts_as_versioned end In db/migrate/****_create_posts.rb def self.up create_table :posts do |t| t.string :title t.text :body t.timestamps end [...]
Posted in Ruby on Rails | Also tagged | Leave a comment

using rails paperclip plugin on ubuntu

paperclip is an awesome plugin for rails. it let’s you attach an image to any of your models. installation and usage more information is available at http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ by default paperclip uses the image magick library for image manipulation/resizing. you’ll need to install this library as well as the ruby api to it in order to use [...]
Posted in Programming, Ruby on Rails | Also tagged | Leave a comment