kete/tiny_mce — pull request #9 by franciscoj (2011-10-19 11:38:31+00:00)
Title: Allow to use use_tiny_mce from before_filters

Hi!

I've done some modifications to `TinyMCE::Base` so that you can call `use_tiny_mce` from a before filter in addition to the current method. This allows you to do things like that.

```ruby
class PhotosController < ApplicationController
before_filter :load_resources
before_filter :set_tiny_mce

def index
respond_to do |format|
format.html
format.js
end
end

protected

def load_resources
@article = Article.find(params[:article_id]
@photos = @article.photos
end

def set_tiny_mce
use_tiny_mce :only => [:new, :edit], :options => {
:external_images_list_url => photos_url(@article)
}
end
end
```

I hope you find it usefult. Thanks a lot for the plugin!!