-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Customizing views
benyamin marx edited this page May 30, 2013
·
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
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
Since doorkeeper is an isolated engine, you'll have to prefix main_app
in all routes and helpers that belong 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 %>