parent
dadf9da477
commit
85e89f5c09
@ -0,0 +1,30 @@
|
|||||||
|
module StoresHelper
|
||||||
|
def attachFromUrl attachment
|
||||||
|
container = attachment.container
|
||||||
|
case container.to_s
|
||||||
|
when 'Message'
|
||||||
|
board_message_path(container.board, container)
|
||||||
|
when 'Issue'
|
||||||
|
issue_path(container)
|
||||||
|
when 'Document'
|
||||||
|
document_path container
|
||||||
|
when 'HomeworkAttach'
|
||||||
|
bid_path(container.bid)
|
||||||
|
when 'Memo'
|
||||||
|
forum_memo_path(container.forum, container)
|
||||||
|
when 'News'
|
||||||
|
news_path(container)
|
||||||
|
when 'Project'
|
||||||
|
project_files_path(container)
|
||||||
|
when 'Version'
|
||||||
|
# version_path(container)
|
||||||
|
project_files_path(container.project)
|
||||||
|
when 'WikiPage'
|
||||||
|
project_wiki_path(container.project)
|
||||||
|
when 'Bid'
|
||||||
|
bid_path(container)
|
||||||
|
else
|
||||||
|
logger.error "StoresHelper#attachUrl unkown type ==> #{container}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue