From 2d4e568bdb7d321c509c406d210cb2c48517e967 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Thu, 3 Sep 2015 13:35:15 -0400 Subject: [PATCH] Fix course routes --- app/views/courses/show.html.haml | 6 +++--- app/views/layouts/wiki.html.haml | 2 +- app/views/wiki/index.html.haml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/courses/show.html.haml b/app/views/courses/show.html.haml index 7a14407..4f6cfa5 100644 --- a/app/views/courses/show.html.haml +++ b/app/views/courses/show.html.haml @@ -38,11 +38,11 @@ - @course.wiki_pages.find_front_page.each do |wiki| %li{highlight(wiki.id)} .cmd{:style => 'margin-bottom: -27px; margin-top: -9px;'} - =action_icon 'arrow2_n', 'Mover para cima', move_up_course_wiki_instance_url(@course, wiki) unless wiki.first? - =action_icon 'arrow2_s', 'Mover para baixo', move_down_course_wiki_instance_url(@course, wiki) unless wiki.last? + =action_icon 'arrow2_n', 'Mover para cima', move_up_course_wiki_instance_url(@course.to_param, wiki.id) unless wiki.first? + =action_icon 'arrow2_s', 'Mover para baixo', move_down_course_wiki_instance_url(@course.to_param, wiki.id) unless wiki.last? - if wiki.last? %span{:style => 'margin-right: 14px'}   - =link_to h(wiki.title), course_wiki_instance_url(@course, wiki) + =link_to h(wiki.title), course_wiki_instance_url(@course.to_param, wiki.id) - if @course.wiki_pages.empty? %li.no_itens Nenhuma página wiki - else diff --git a/app/views/layouts/wiki.html.haml b/app/views/layouts/wiki.html.haml index e484e3e..03288d7 100644 --- a/app/views/layouts/wiki.html.haml +++ b/app/views/layouts/wiki.html.haml @@ -5,7 +5,7 @@ = link_to(h(@course.full_name), course_url(@course)) + "›" = link_to("Wiki", course_wiki_url(@course)) - if @wiki_page.title? - = "›" + link_to(h(@wiki_page.title), course_wiki_instance_url(@course, @wiki_page)) + = "›" + link_to(h(@wiki_page.title), course_wiki_instance_url(@course.to_param, @wiki_page)) - @title = @title + " - #{h(@wiki_page.title)}" - @left_panel = render 'courses/left_panel' diff --git a/app/views/wiki/index.html.haml b/app/views/wiki/index.html.haml index 6fd712e..288a46e 100644 --- a/app/views/wiki/index.html.haml +++ b/app/views/wiki/index.html.haml @@ -8,7 +8,7 @@ - if !@course.wiki_pages.empty? %ul - @course.wiki_pages.find(:all, :order => 'title').each do |w| - %li= link_to(w.title, course_wiki_instance_url(@course, w)) + %li= link_to(w.title, course_wiki_instance_url(@course.to_param, w.id)) - else .box