mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
WIP - Update loading of helpers in controllers
Rails has changed the way helpers are loaded. It's a bit weird. It was throwing lots of errors, and recommended using this setting, but now requires that all helpers are loaded explicitly. I'm not sure about this.
This commit is contained in:
@@ -13,6 +13,18 @@ class ApplicationController < ActionController::Base
|
||||
self.responder = ApplicationResponder
|
||||
respond_to :html
|
||||
|
||||
helper 'spree/base'
|
||||
helper 'spree/orders'
|
||||
helper 'shared'
|
||||
helper 'enterprises'
|
||||
helper 'order_cycles'
|
||||
helper 'order'
|
||||
helper 'shop'
|
||||
helper 'injection'
|
||||
helper 'markdown'
|
||||
helper 'footer_links'
|
||||
helper 'discourse'
|
||||
|
||||
protect_from_forgery
|
||||
|
||||
include Spree::Core::ControllerHelpers::Auth
|
||||
|
||||
@@ -13,8 +13,6 @@ class BaseController < ApplicationController
|
||||
include I18nHelper
|
||||
include OrderCyclesHelper
|
||||
|
||||
helper 'spree/base'
|
||||
|
||||
before_action :set_locale
|
||||
before_action :check_order_cycle_expiry
|
||||
|
||||
|
||||
@@ -3,7 +3,12 @@ module Spree
|
||||
class BaseController < ApplicationController
|
||||
ssl_required
|
||||
|
||||
helper 'shared'
|
||||
helper 'spree/admin/navigation'
|
||||
helper 'spree/admin/orders'
|
||||
helper 'admin/injection'
|
||||
helper 'admin/orders'
|
||||
|
||||
layout '/spree/layouts/admin'
|
||||
|
||||
include I18nHelper
|
||||
|
||||
@@ -200,5 +200,7 @@ module Openfoodnetwork
|
||||
config.active_support.escape_html_entities_in_json = true
|
||||
|
||||
config.active_job.queue_adapter = :delayed_job
|
||||
|
||||
config.action_controller.include_all_helpers = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,7 @@ require "spec_helper"
|
||||
|
||||
describe "spree/admin/shared/_order_links.html.haml" do
|
||||
helper Spree::BaseHelper # required to make pretty_time work
|
||||
helper Spree::Admin::OrdersHelper
|
||||
|
||||
before do
|
||||
order = create(:order)
|
||||
|
||||
Reference in New Issue
Block a user