blog index using page index

This commit is contained in:
Torsten Ruger 2017-06-11 22:19:44 +03:00
parent a961dce0fa
commit 9fa9739e2d
4 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,5 @@
## Title
### Subtitle
And some text

View File

@ -0,0 +1,5 @@
%h1 Index
- @pages.each do |title , page|
%h3= link_to page.title , blog_page_path(page.title)
%p= page.content

View File

@ -29,5 +29,5 @@ Rails.application.routes.draw do
root to: 'high_voltage/pages#show' , id: 'index'
get "/blog" , to: "blog#index" , as: :blog_index
get "/blog/*slug" , to: "blog#page" , as: :blog_page
get "/blog/*title" , to: "blog#page" , as: :blog_page
end

View File

@ -0,0 +1,10 @@
feature 'Blog index' do
scenario 'index shows' do
visit blog_index_url
expect(page).to have_content("Index")
end
end