From ad3c67f924ed82fca404c26ed3491ec4320fd4ba Mon Sep 17 00:00:00 2001 From: jomo Date: Fri, 2 Aug 2013 08:14:32 +0200 Subject: [PATCH] wrong order fix --- app/controllers/forumgroups_controller.rb | 2 +- app/views/forumgroups/index.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/forumgroups_controller.rb b/app/controllers/forumgroups_controller.rb index 2cb3a8b..208d408 100644 --- a/app/controllers/forumgroups_controller.rb +++ b/app/controllers/forumgroups_controller.rb @@ -1,6 +1,6 @@ class ForumgroupsController < ApplicationController def index - @groups = Forumgroup.all.sort{|s| s[:position]} + @groups = Forumgroup.all.sort_by{|s| s[:position]} end end \ No newline at end of file diff --git a/app/views/forumgroups/index.html.erb b/app/views/forumgroups/index.html.erb index 12ebe60..1a08c83 100644 --- a/app/views/forumgroups/index.html.erb +++ b/app/views/forumgroups/index.html.erb @@ -2,11 +2,11 @@ <% @groups.each do |g| %>
- <%= g.name %> + <%= g.name %> - <%= g.position %> - <%= g.id %>
- <% g.forums.sort{|s| s[:position]}.each do |f| %> + <% g.forums.sort_by{|s| s[:position]}.each do |f| %>
<%= f.name %>