friendly urls
This commit is contained in:
@@ -5,7 +5,7 @@ class ForumgroupsController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
redirect_to forums_path + "#group-#{params[:id]}"
|
||||
redirect_to forums_path + "#group-#{params[:id].to_i}"
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@@ -26,6 +26,10 @@ class Blogpost < ActiveRecord::Base
|
||||
!!user_editor_id
|
||||
end
|
||||
|
||||
def to_s
|
||||
title
|
||||
end
|
||||
|
||||
def send_new_mention_mail(old_content = "")
|
||||
new_mentions = mentions(content) - mentions(old_content)
|
||||
mails = []
|
||||
@@ -42,4 +46,7 @@ class Blogpost < ActiveRecord::Base
|
||||
background_mailer(mails)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,4 +23,8 @@ class Forum < ActiveRecord::Base
|
||||
def can_write?(user)
|
||||
group.can_write?(user) && can_read?(user) && (role_write.nil? || (!user.nil? && user.role >= role_write))
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
@@ -20,4 +20,8 @@ class Forumgroup < ActiveRecord::Base
|
||||
def can_write?(user)
|
||||
!user.nil? && can_read?(user) && user.confirmed? && (role_write.nil? || user.role >= role_write)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,4 +57,8 @@ class Forumthread < ActiveRecord::Base
|
||||
end
|
||||
background_mailer(mails)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
@@ -3,4 +3,12 @@ class Info < ActiveRecord::Base
|
||||
|
||||
validates_presence_of :title, :content
|
||||
|
||||
def to_s
|
||||
title
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -80,6 +80,10 @@ class User < ActiveRecord::Base
|
||||
return image_tag("https://minotar.net/helm/#{CGI.escape(self.ign)}/#{CGI.escape(size.to_s)}", options)
|
||||
end
|
||||
|
||||
def to_s
|
||||
ign
|
||||
end
|
||||
|
||||
|
||||
|
||||
#check if this user is an idiot and uses their mc password.
|
||||
@@ -176,6 +180,10 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="user">
|
||||
<%= link_to user.name, user_path(user.id), class: "role #{user.role.name} #{"banned" if user.banned?} #{"disabled" if user.disabled?} #{"unconfirmed" unless user.confirmed?}", title: user.ign %>
|
||||
<%= link_to user.name, user, class: "role #{user.role.name} #{"banned" if user.banned?} #{"disabled" if user.disabled?} #{"unconfirmed" unless user.confirmed?}", title: user.ign %>
|
||||
<%= link_to "$", donate_statics_path, class: "role donor", title: "Donator" if user.donor? %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user