mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 21:57:19 +00:00
Extract path_without_format
private methd in accounts controller (#28091)
This commit is contained in:
parent
c824d98cec
commit
baf3b71e3b
|
@ -85,14 +85,18 @@ class AccountsController < ApplicationController
|
||||||
helper_method :rss_url
|
helper_method :rss_url
|
||||||
|
|
||||||
def media_requested?
|
def media_requested?
|
||||||
request.path.split('.').first.end_with?('/media') && !tag_requested?
|
path_without_format.end_with?('/media') && !tag_requested?
|
||||||
end
|
end
|
||||||
|
|
||||||
def replies_requested?
|
def replies_requested?
|
||||||
request.path.split('.').first.end_with?('/with_replies') && !tag_requested?
|
path_without_format.end_with?('/with_replies') && !tag_requested?
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_requested?
|
def tag_requested?
|
||||||
request.path.split('.').first.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize)
|
path_without_format.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize)
|
||||||
|
end
|
||||||
|
|
||||||
|
def path_without_format
|
||||||
|
request.path.split('.').first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue