Skip to content
felipeelias edited this page Feb 28, 2012 · 5 revisions

To customize the views that doorkeeper uses, you have to generate them into your app.

rails generate doorkeeper:views

This will copy all the views to app/views/doorkeeper

Overriding layouts

To use your own layouts you can override the application one or each layout separately:

In config/application.rb, add:

config.to_prepare do
  # Base layout. Uses app/views/layouts/my_layout.html.erb
  Doorkeeper::ApplicationController.layout "my_layout"

  # Only Applications list
  Doorkeeper::ApplicationsController.layout "my_layout"

  # Only Authorization endpoint
  Doorkeeper::AuthorizationsController.layout "my_layout"

  # Only Authorized Applications
  Doorkeeper::AuthorizedApplicationsController.layout "my_layout"
end

Using helpers

Since doorkeeper is an isolated engine, you'll have to prefix main_app in all routes and helpers that belongs to your application:

<% if main_app.user_signed_in? %>
  <%= link_to "Sign Out", main_app.destroy_user_session_path, :method => 'delete' %>
<% else %>
  <%= link_to "Sign In", main_app.new_user_session_path %>
<% end %>
Clone this wiki locally