Cross Reference: path_helpers.rb
xref
: /
ontohub
/
app
/
controllers
/
path_helpers.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
path_helpers.rb revision ee5342a8882c2fc7631fcffb5497e6597747887c
module
PathHelpers
extend
ActiveSupport
::
Concern
included
do
helper_method
:
fancy_repository_path
, :
in_ref_path
?
end
def
in_ref_path
?
!
params
[:
ref
].
nil
?
end
def
fancy_repository_path
(
repository
,
args
)
args
||= {}
action
=
args
[:
action
] || :
files
if
!
in_ref_path
? &&
action
== :
files
repository_tree_path
repository
,
path
:
args
[:
path
]
else
repository_ref_path
repository_id
:
repository
,
ref
:
args
[:
ref
],
action
:
action
,
path
:
args
[:
path
]
end
end
end