Sha256: 139844bcc66e0ac52fdf150ef7b51e944f718df31df2ec753952422e717972ed
Contents?: true
Size: 875 Bytes
Versions: 29
Compression:
Stored size: 875 Bytes
Contents
module Devise module Controllers module ScopedViews extend ActiveSupport::Concern module ClassMethods def scoped_views? defined?(@scoped_views) ? @scoped_views : Devise.scoped_views end def scoped_views=(value) @scoped_views = value end end protected # Render a view for the specified scope. Turned off by default. # Accepts just :controller as option. def render_with_scope(action, path=self.controller_path) if self.class.scoped_views? begin render :template => "#{devise_mapping.scoped_path}/#{path.split("/").last}/#{action}" rescue ActionView::MissingTemplate render :template => "#{path}/#{action}" end else render :template => "#{path}/#{action}" end end end end end
Version data entries
29 entries across 28 versions & 4 rubygems