{"record":{"id":"891d436b2fc20110","repo":"flippercloud/flipper","slug":"template-does-not-exist-path","errorCode":null,"errorMessage":"Template does not exist: #{path}","messagePattern":"Template does not exist: #(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/flipper/ui/action.rb","lineNumber":220,"sourceCode":"        def active?\n          @href.nil?\n        end\n      end\n\n      # Private\n      def view_with_layout(&block)\n        view :layout, &block\n      end\n\n      # Private\n      def view_without_layout(name)\n        view name\n      end\n\n      # Private\n      def view(name)\n        path = views_path.join(\"#{name}.erb\")\n        raise \"Template does not exist: #{path}\" unless path.exist?\n\n        eval(Erubi::Engine.new(path.read, escape: true).src)\n      end\n\n      # Internal: The path the app is mounted at.\n      def script_name\n        request.env['SCRIPT_NAME']\n      end\n\n      # Internal: Generate urls relative to the app's script name.\n      #\n      #   url_for(\"feature\")             # => \"http://localhost:9292/flipper/feature\"\n      #   url_for(\"/thing\")              # => \"http://localhost:9292/thing\"\n      #   url_for(\"https://example.com\") # => \"https://example.com\"\n      #\n      def url_for(*parts)\n        URI.join(request.base_url, script_name + '/', *parts).to_s\n      end","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/ui/action.rb#L202-L238","documentation":"Flipper::UI actions render ERB templates from the gem's views directory (views_path defaults to Flipper::UI.root/views); the private view(name) helper raises unless views_path.join(\"#{name}.erb\") exists, then evaluates it with Erubi (lib/flipper/ui/action.rb:218-223). The raise means the action asked for a template that is not on disk at the exact path printed — almost always a custom action subclass referencing a view that was never created, or a broken/partial flipper-ui gem install missing the views directory.","triggerScenarios":"A Flipper::UI::Action subclass registered with self.route whose request method calls view_response(:name) or view(:name) with no matching views/<name>.erb under Flipper::UI.root/views; or rendering a built-in action against a flipper-ui installation whose lib/flipper/ui/views directory is missing/renamed (bad gem build, partial git checkout, vendored copy).","commonSituations":"Writing custom UI actions for a mounted Flipper::UI and forgetting the template; renaming a template file without updating view_response calls; vendoring or forking flipper-ui and not copying the views directory; installing the gem from a git ref that excludes views.","solutions":["Create the .erb file at the exact path shown in the error message (it is the absolute path the adapter checked).","Verify where UI looks: puts Flipper::UI::Action.views_path — then ensure that directory contains <name>.erb; for custom actions, keep the template next to the built-ins or adjust views_path before the first render.","If built-in pages raise, reinstall/align the flipper-ui gem (gem contents flipper-ui | grep views) so the shipped templates match the action code.","Boot script/server and hit the route to confirm the template resolves."],"exampleFix":"# before: custom action renders a view that was never created\nclass GateRollout < Flipper::UI::Action\n  route %r{\\A/gate_rollout\\z}\n\n  def get\n    view_response :gate_rollout # raises 'Template does not exist: .../views/gate_rollout.erb'\n  end\nend\n\n# after: create the template the error points to\n# file: <views_path>/gate_rollout.erb\n#   <h1>Gate Rollout</h1>\n#   <% @features.each do |feature| %>\n#     <div><%= feature.key %></div>\n#   <% end %>","handlingStrategy":"validation","validationCode":"def render_view(action, name)\n  path = Flipper::UI::Action.views_path.join(\"#{name}.erb\")\n  raise ArgumentError, \"missing template: #{path}\" unless path.exist?\n  action.view_response(name)\nend","typeGuard":"def template_exists?(name)\n  Flipper::UI::Action.views_path.join(\"#{name}.erb\").exist?\nend","tryCatchPattern":null,"preventionTips":["Add a CI spec that boots every custom action and asserts its view_response names have matching .erb files.","Keep view names and template filenames identical (gate_rollout -> gate_rollout.erb).","After upgrading or vendoring flipper-ui, verify the gem ships lib/flipper/ui/views (gem contents flipper-ui).","Smoke-test the mounted UI with script/server after changes to actions or templates."],"tags":["ruby","flipper-ui","erb","templates","custom-action"],"backgroundTag":"missing-template-file","analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}