- You will need to add the config to initializer.
- Create the view.
- (re)start your Rails server.
- Override (or better solution) the pages action (see "app/views/refinery/admin/pages/_actions.html.erb" in this gist for an example) or else, add ?view_template=my_content_type to the page's new URL. Ie: http://localhost:3000/refinery/pages/new?view_template=my_content_type
See some screenshots:
http://cl.ly/2W2Z1E342B3c2x1Q1I3t
jipiboily, thanks for your reply.
You already mentioned earlier I should add this line.
I played little bit around and I found out that I actually need to add this:
"config.use_view_templates = true" inside config/initializers/refinery/pages.rb. But thanks anyway.
Also I was thinking a lot about what robyurkowski said yesterday during our conversation.
This is the part that I didn't understand:
[20:39] <+robyurkowski> if you need to make different data available
[20:39] <+robyurkowski> you have two different options
[20:39] <+robyurkowski> 1, the poorest choice, you can make it all available to pages#show and then choose what to display inside a template
[20:39] <+robyurkowski> 2, the best choice, you can add a new method, add a route to it, and add a template
[20:39] <+robyurkowski> and then just direct to /my-method
Do you maybe have an idea what he meant under 2. choice? Also, my assumption first is that this 2. choice is alternative on the procedure you explained to me in this gist. Right?
Then, under that assumption, I tried to follow his guides
-> so i overriden pages controller, and added:
then I made "bidon.html.erb" inside app/views/pages/bidon,
and added this content:
Hello World
then in the routes file I added:
match 'novi-template' => 'pages#bidon'
where 'novi-template' is the name of the page I created in backend. That means - if i click on 'novi-template' page, then use pages controller, action "bidon" and render view/template "bidon".
Under all my assumptions, this process did not work.
Do you have some guidelines or some thoughts about this "2., the best choice" robyurkowski mentioned?