Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
c659dbb1
Commit
c659dbb1
authored
9 years ago
by
Matheus Agio Nerone
Browse files
Options
Downloads
Patches
Plain Diff
fixing routes
Signed-off-by:
man13
<
man13@inf.ufpr.br
>
parent
91730cd8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/learning_objects_controller.rb
+13
-13
13 additions, 13 deletions
app/controllers/learning_objects_controller.rb
with
13 additions
and
13 deletions
app/controllers/learning_objects_controller.rb
+
13
−
13
View file @
c659dbb1
...
...
@@ -42,14 +42,7 @@ class LearningObjectsController < ApplicationController
respond_to
do
|
format
|
if
publisher
.
create_draft
@draft
# go to file submission page
if
@draft
.
type
==
'Link Externo'
notice
=
'Seu objeto foi criado! Para que ele seja publicado é necessário informar um link.'
path
=
upload_link_learning_object_path
(
id:
@draft
.
id
)
else
notice
=
'Seu objeto foi criado! Para que ele seja publicado é necessário enviar o arquivo.'
path
=
upload_learning_object_path
(
id:
@draft
.
id
)
end
format
.
html
{
redirect_to
path
,
notice:
notice
}
format
.
html
{
redirect
}
else
format
.
html
{
redirect_to
new_learning_object_path
,
notice:
'Não foi possível criar o objeto.'
}
end
...
...
@@ -135,11 +128,11 @@ class LearningObjectsController < ApplicationController
@type
=
@learning_object
.
type
else
@type
=
case
@learning_object
.
default_attachment
.
mime_type
when
/image\//i
then
'Imagem'
when
/audio\//i
then
'Áudio'
when
/video\//i
then
'Vídeo'
when
'application/pdf'
then
'PDF'
end
when
/image\//i
then
'Imagem'
when
/audio\//i
then
'Áudio'
when
/video\//i
then
'Vídeo'
when
'application/pdf'
then
'PDF'
end
end
end
...
...
@@ -154,4 +147,11 @@ class LearningObjectsController < ApplicationController
end
end
def
redirect
if
@draft
.
type
==
"Link Externo"
redirect_to
learning_object_path
(
id:
@draft
.
id
)
,
notice:
'Seu objeto foi criado com sucesso!'
else
redirect_to
upload_learning_object_path
(
id:
@draft
.
id
)
,
notice:
'Seu objeto foi criado! Para que ele seja publicado é necessário enviar o arquivo.'
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment