Skip to content

Commit

Permalink
getting rid of main_app references in layouts
Browse files Browse the repository at this point in the history
When devs reference `_url` and `_path` URL helpers in their layouts (shared by Koudoku) they necessarily have to prepend those with `main_app` which is a trip wire for a lot of people. 
Trying to solve that in the most elegant way possible. Inspired by http://stackoverflow.com/questions/9232175/access-main-app-helpers-when-overridings-a-rails-engine-view-layout#comment44856124_19453140
  • Loading branch information
yas4891 committed May 5, 2015
1 parent 75d51d1 commit 8a03945
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/koudoku/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ module Koudoku
class ApplicationController < ::ApplicationController
layout 'application'
helper :application

# stolen from http://stackoverflow.com/questions/9232175/access-main-app-helpers-when-overridings-a-rails-engine-view-layout#comment44856124_19453140
# to solve the problem of having to reference "main_app.$some_model_path" in layouts
helper Rails.application.routes.url_helpers
end
end

0 comments on commit 8a03945

Please sign in to comment.