-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use redactor-rails without devise #85
Comments
I solved this by not relying on including the Instead of having this class RedactorRails::Asset < ActiveRecord::Base
include RedactorRails::Orm::ActiveRecord::AssetBase
delegate :url, :current_path, :size, :content_type, :filename, :to => :data
validates_presence_of :data
end I have this require 'redactor-rails/orm/base'
class RedactorRails::Asset < ActiveRecord::Base
include RedactorRails::Orm::Base::AssetBase::InstanceMethods
self.table_name = 'redactor_assets'
belongs_to :assetable, :polymorphic => true
attr_accessible :data, :assetable_type, :assetable_id, :assetable
delegate :url, :current_path, :size, :content_type, :filename, :to => :data
validates_presence_of :data
end |
The above doesn't work. The only way I got it to work without authentication was to go back to an older version gem 'redactor-rails', '0.3.3' Then just make sure you take the user_id column out of the migration (or make a new migration remove the user_id column if it's already in the DB), and you're good to go. |
KevinSjoberg's workaround works in Rails 4 if you delete the attr_accessible line. |
In the documentation, it seems that we could use redactor-rails without the devise option.
However, it seems that user_id is needed. Otherwise, it raises an error due to redactor_authenticate_user! (before_filter)
I've succeeded to implement this like so:
config/redactor.rb
app/controllers/application_controller.rb
Is there is a better way to implement this or is there a bug when not passing the devise option ? Thanks
The text was updated successfully, but these errors were encountered: