SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

Cancan friendlier. #4

Closed computeus closed 12 years ago

computeus commented 12 years ago

This method might be useful for cases where you have code that runs for every request (for example, in your application_controller) but you want to do something different based on whether the request is being handled by redactor_rails pictures_controller or your app. You can define a redactor_rails_controller? method in your application_controller that returns false, and it will be overridden to return true for redactor_rails pictures_controller.

computeus commented 12 years ago

Hi,

I want to use redactor in my project. I use cancan for authorization.

So I made some changes for redactor_rails gem to be cancan gem friendlier.

If abitiy.rb has

can :access, :redactor_rails

then user can upload photo.

But I think it will be a good idea if cancan integration tied to configuration file, like in rails_admin.

computeus commented 12 years ago

By the way, I need the latest redactor.js so I updated it too.