diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 3174d37..117fa28 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -2,7 +2,7 @@ class PagesController < ApplicationController def show - @slug = params[:slug] + @slug = params[:id] if @slug diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index b359685..e249f69 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -29,7 +29,7 @@ #menu =link_to image_tag("logo.png", :id => "logo"), "/" - =link_to raw("

A propos

"), "a-propos.html" + =link_to raw("

A propos

"), page_path("a-propos") %h4 @@ -39,8 +39,8 @@ %ul.portfolios_links =render Portfolio.order(:title) - =link_to raw("

Partenaires

"), "partenaires.html" - =link_to raw("

Contact

"), "contact.html" + =link_to raw("

Partenaires

"), page_path("partenaires") + =link_to raw("

Contact

"), page_path("contact") -if @images diff --git a/app/views/portfolios/_portfolio.haml b/app/views/portfolios/_portfolio.haml index a33af63..2ee02ca 100644 --- a/app/views/portfolios/_portfolio.haml +++ b/app/views/portfolios/_portfolio.haml @@ -1,5 +1,5 @@ %li#portfolio_line{:id => portfolio.id} - =link_to portfolio.title, portfolio.path + =link_to portfolio.title, portfolio_path(portfolio.slug, :format => :html) -if current_admin =link_to i(:pen_alt_fill,:white,32, :style => "width:10px;"), edit_portfolio_path(portfolio, :format => "js"), :remote => true diff --git a/config/routes.rb b/config/routes.rb index 49dcb52..6856889 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ SitePerso::Application.routes.draw do - match ":slug.:format" => 'pages#show', :as => :page, :format => "html" + match ":id.:format" => 'pages#show', :as => :page, :format => "html" resources :portfolios #match "galerie/:slug.:format" => 'portfolios#show', :as => :portfolio, :format => "html", :via => :get