2

I want to make a navigation menu with the titles of published pages. In the user manual I can see the format which I should use in the layout:

{{ cms:partial:path/to/partial }}

So I create a partial with a name _navmenu.html.haml and place it in app/views/ directory. I think I should refer to this partial like this :

 {{ cms:partial:app/views/navmenu}}

but I only see the error message of the ActionController:

Missing partial app/views/navbar with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
* "/Users/qumara/mexicansofa/app/views"  

It seems it searches in app/views directory. I suppose partial in Comfy is referred by Rails conventions (with underscore prefix).

The stack: Ruby on Rails 3.2.14, comfortable-mexican-sofa 1.8.4 .

How should I refer (from the layout) to a partial in Comfortable Mexican Sofa?

Any help is appreciated.

R Milushev
  • 4,295
  • 3
  • 27
  • 35

1 Answers1

5

It knows its already in app/views so simply {{ cms:partial:navmenu }} should work

If you have it in a folder within app/views, app/views/admin/navmenu for example it would be {{ cms:partial:admin/navmenu }}

Edit: For people that haven't read the comments, the answer is to put the file you are trying to render inside a folder within views then it works.

DickieBoy
  • 4,886
  • 1
  • 28
  • 47
  • Thank you for your answer. Is the naming convention the same as in Rails : `_navmenu.html.haml` (with underscore)? – R Milushev Oct 18 '13 at 16:56
  • yes, exactly the same, comfy literally calls <% render :partial => :foo %> – DickieBoy Oct 18 '13 at 17:02
  • It is really strange: I did the things that we discuss and the error message changed : `Missing partial cms_content/navbar, application/navbar with ....` . Now the search is in `cms_content` and `application` ? In case that I am not aware of directory with a name `application`... – R Milushev Oct 18 '13 at 17:05
  • Hehe `navbar` vs `navmenu` ? – DickieBoy Oct 18 '13 at 17:07
  • Actually I use `_navbar` , it is not a typo unfortunately. `navmenu` was only example. Got an eye, I admit it... – R Milushev Oct 18 '13 at 17:11
  • Ok, thought it might have been... Looking at my app i don't have any views that are just in the views directory, they are all in sub folders. Apart from the subfolder thing, im doing exactly the same: `{{ cms:partial:components/page_list }}` and thats stored in `app/views/components/_page_list.html.haml` – DickieBoy Oct 18 '13 at 17:15
  • I'll try to move it on a subfolder, nice idea indeed. – R Milushev Oct 18 '13 at 17:18
  • Where is located your `components` dir? And what is your comfy version? – R Milushev Oct 18 '13 at 17:21
  • Yeeeyyyy! That was it: when I created a separated dir `components` (I should pay royalties to you), it all happened!!! Thank you for your patience and have a nice weekend. – R Milushev Oct 18 '13 at 17:31
  • 1
    Im actually using a fork of comfy, with some(quite nice) added features, check it out: https://github.com/homeserve-alliance/comfortable-mexican-sofa – DickieBoy Oct 20 '13 at 10:02
  • Your efforts are remarkable. Really useful features are added. – R Milushev Oct 20 '13 at 17:24