Search code examples
ruby-on-railsrefinerycms

how to override an extension view in RefineryCms


I'm following the getting started project provided it for refineryCms for testing several things. Right now I want to override the events view. But I can not get the correct path for finding and overriding.

http://refinerycms.com/guides/getting-started#generating-an-extension

I'm trying

rake refinery:override view=refinery/pages/events/show

rake refinery:override view=refinery/events/show

Couldn't match any view template files in any extensions like refinery/events/show

and a lot of combinations but without luck.

What is the right form to find the view and override it??

Thanks

Edit: when I try to use the wildcards I got this error:

zsh: no matches found: view=refinery/events/events/*

I had tried a lot of things, But I'm guessing, and I disliked that. there are some "formula" to get the correct path?

Thanks again


Solution

  • Refinery extensions have their own view folder; so if you have events, it will put the view in /app/views/events. Have you tried with this wildcard '*' at the end, such as:

    rake refinery:override view=refinery/events/*
    

    You can override all views with

    rake refinery:override view=refinery/*
    

    Also, I had an extensions where it put the directory inside of a directory, so for example you can try to put two directories:

     rake refinery:override view=refinery/events/events/*