Search code examples
ruby-on-railsruby-on-rails-3deviseruby-on-rails-3.2refinerycms

Simple Rails 3.2 app + RefineryCMS + devise


I had a simple Rails 3.2 app and later added RefineryCMS by following the official guide (http://refinerycms.com/guides/with-an-existing-rails-app). Now I want to add devise to the Rails app to restrict public content based in the logged in user.

I know that there is an official RefineryCMS guide about adding RefineryCMS to existing Rails app + devise (http://refinerycms.com/guides/with-an-existing-rails-31-devise-app), but my scenario is different as in my case now devise is to be added. Any specific steps that I need to keep in mind. It would be good if someone can point me to a tutorial. Thanks.


Solution

  • I followed the procedure in the guide http://refinerycms.com/guides/with-an-existing-rails-31-devise-app.

    There were errors

    • undifined method 'new_refinery_user_registeration_path' and on refresh
    • uninitialized constant Refinery::Role

    and for that I had to replace ::Refinery::Role to ::Role in user model and override refinery_user_required? and just installed? in lib/refinery/refinery_patch.rb

    def refinery_user_required?
      false
    end
    
    def just_installed?
     false
    end