Closed frojnd closed 2 weeks ago
I have a bug somewhere in my project. Just tired with a blank kemal project and data is being transferred among the views...
So if anyone else finds this issue. Problem was with all the other routes that were rendering layout.ecr or rooms.ecr but get route itself didn't have |env| defined for example:
get "/" do
if true
rooms_data = get_rooms(worst = 3)
render "src/views/home.ecr", "src/views/layout.ecr"
else
"ONBOARDING"
end
end
After adding |env| to the route problem solved itself.
Description
Consider following:
I would expect to have rooms_data inside "src/views/layout.ecr" But I get: Error: undefined local variable or method 'rooms_data' for Household:Module when calling
<%= rooms_data %>
Also how can I pass besides rooms_data also path to both views?
Thank you.