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 %>