Skip to content

Commit 61f0aa2

Browse files
committed
fixed route helper usage through adjusted context object
1 parent fd52db5 commit 61f0aa2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/lib/matestack/ui/core/rendering/main_renderer.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ def render(controller_instance, page_class, options)
6161
end
6262
end
6363

64+
# needs refactoring!
65+
# we shouldn't pass in the parts of the controller_instance and the instance itself
6466
def create_context_hash(controller_instance)
6567
{
6668
view_context: controller_instance.view_context,
6769
params: controller_instance.params,
68-
request: controller_instance.request
70+
request: controller_instance.request,
71+
controller: controller_instance # if this is not included here, rails route helpers will fail with undefined method `url_options' for nil:NilClass in some cases
6972
}
7073
end
7174

0 commit comments

Comments
 (0)