lib/phlexible/rails/action_controller/implicit_render.rb in phlexible-0.4.2 vs lib/phlexible/rails/action_controller/implicit_render.rb in phlexible-0.5.0
- old
+ new
@@ -4,11 +4,11 @@
#
# class UsersController
# def index
# render Views::Users::Index.new
# end
-
+#
# def show
# render Views::Users::Show.new(user)
# end
# end
#
@@ -28,9 +28,11 @@
def assign_phlex_accessors(pview)
pview.tap do |view|
if view.respond_to?(:__controller_attributes__)
view.__controller_attributes__.each do |attr|
+ raise ControllerAttributes::UndefinedVariable, attr unless view_assigns.key?(attr.to_s)
+
view.instance_variable_set :"@#{attr}", view_assigns[attr.to_s]
end
end
end
end