Project

General

Profile

Actions

Bug #7613

closed

Error rendering searcheable list pages in a new plugin

Added by Dennis Kliban about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I am developing a Foreman plugin that adds ability to keep track of Image Stores, such as Image Factory. I would like the user to be able to search images. As a result I have made a searcheable list page. However, I get the following error when I try to render the page ...

Showing /home/dkliban/foreman/app/views/common/_searchbar.html.erb where line #18 raised:

undefined method `new_bookmark_path' for #<#<Class:0x00000008255078>:0x00000009c4c2b0>
Extracted source (around line #18):

15: <% end >
16: <li class="divider"></li>
17: <li><
= link_to_function _('Bookmark this search'), "$('#bookmarks-modal').modal();",
18: {:id => "bookmark", :"data-url"=> new_bookmark_path(:kontroller => controller_name)}%></li>
19: </ul>
20: </span>
21: </div>

I am able to fix this problem by applying the following diff to Foreman

diff --git a/app/views/common/_searchbar.html.erb b/app/views/common/_searchbar.html.erb
index 2ff07ce..0f61638 100644
--- a/app/views/common/_searchbar.html.erb
+++ b/app/views/common/_searchbar.html.erb
@@ -15,7 +15,7 @@
         <% end %>
         <li class="divider"></li>
         <li><%= link_to_function _('Bookmark this search'), "$('#bookmarks-modal').modal();",
-                                 {:id => "bookmark", :"data-url"=>new_bookmark_path(:kontroller => controller_name)}%></li>
+                                 {:id => "bookmark", :"data-url"=>main_app.new_bookmark_path(:kontroller => controller_name)}%></li>
       </ul>
     </span>
   </div>

Can this diff be permanently added?

Actions #1

Updated by Dominic Cleal about 10 years ago

  • Description updated (diff)
  • Category set to Plugin integration

Patches should be submitted as pull requests, we won't pull them from a ticket alone.

See http://theforeman.org/contribute.html for more details. You should reference this ticket in the commit message, e.g. "fixes #7613 - make search bar route lookup usable from isolated engine"

Actions #2

Updated by The Foreman Bot about 10 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.7.3
  • Pull request https://github.com/theforeman/foreman/pull/1795 added
  • Pull request deleted ()
Actions #3

Updated by Dominic Cleal about 10 years ago

  • Assignee set to Dennis Kliban
Actions #4

Updated by Dominic Cleal about 10 years ago

  • Target version changed from 1.7.3 to 1.7.2
Actions #5

Updated by Dennis Kliban about 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Dominic Cleal about 10 years ago

  • Translation missing: en.field_release set to 21
Actions

Also available in: Atom PDF