def just_installed?falseend
root :to => "home#index"
mount Refinery::Core::Engine, :at => '/'
We have used Devise + OmniAuth as authentication mechanism to authenticate user with facebook, twitter and openid in our existing aplication. Now we need to integrate Refinery CMS into the application.
Requirement: The home page of application has Signup/Signin buttons with some static content. On Signing in, user is able to access restricted area. We want to add a link to access Refinery CMS on a restricted page. It should not ask for any credential again.
We followed following links to integrate Refinery CMS:
- http://refinerycms.com/guides/with-an-existing-rails-app
- http://refinerycms.com/guides/with-an-existing-rails-31-devise-app
Now after starting server, when we hit
http://localhost:3000
it redirects tohttp://localhost:3000/refinery/users/register
. Instead user should be able to see home page with public content. User can access refinery CMS(through /help link) only after user authenticate himself with any of authentication providers.Here is snap of config/routes.rb
mount Refinery::Core::Engine, :at => '/'
...
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", registrations: "registrations" }
....
root :to => "home#index"config/application.rb
config.autoload_paths += Dir["#{config.root}/lib/**/"] # to load files from lib directory, including subfolders
config.before_initialize do
require 'refinery_patch'
require 'restrict_refinery_to_refinery_users'
end
include Refinery::Engine
after_inclusion do
[ApplicationController, ApplicationHelper].each do |c|
c.send :include, ::RefineryPatch
end
::Refinery::AdminController.send :include, ::RestrictRefineryToRefineryUsers
::Refinery::AdminController.send :before_filter, :restrict_refinery_to_refinery_users
endWe are beginner. Any help would be appreciable.